Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.88 KB | None | 0 0
  1. @name TARDIS Unofficial By Cookiemorph FixBy dV
  2. @model models/drmatt/tardis/atomaccel.mdl
  3. @inputs
  4. @outputs XYZ:vector
  5. @persist SavePos:vector RefuelCorner1:vector RefuelCorner2:vector SaveAng:angle
  6. @persist Secure Program1 RefuelRandom1 RefuelRandom2 Fuel FuelOn MaxFuel InFlight RefuelTime RefuelTimeTotal Refuelling
  7. @persist FuelLossFlight SecureMemory Paradox ParadoxRandom1 ParadoxRandom2 EpMode EpModeAware CurDeaths Deaths EpDo DoOnce3 DeathCheck Checked
  8. @persist InTeleport FuelLossTeleport DoOnce RandomX RandomY RandomZ LandingLights R R2 R3 RPM LandingLightsLanding DoOnce4
  9. @persist Force Mass LightPassRandom Autospin Calling Skin DoOnce2 HealthDetect Destruct DestructRun BuddySystem AwaitingResponse LandingLightReturn
  10. @persist [I LandingLightModel Model LightPass TName CModel]:string TimeCounter TimeDistort Leaking LeakFixSearch FuelLossLeaking InLoop Teleporting
  11. @persist [TARDIS Buddy LandingLight1 LandingLight2 Player Player2 Target Owner Receiver Holo Interior]:entity
  12. @persist [Explodable1 Explodable2 Explodable3 Explodable4 Explodable5 Exploadable6]:entity
  13. @persist SaidA:array SaidS:string [Colour1 Colour2]:vector BuddySaid:array BuddyTrust OwnerTrust Timer
  14. runOnChat(1)
  15.  
  16. if (first()){
  17. TARDIS=entity():isConstrainedTo():tardisGet()
  18. Interior=entity():isConstrainedTo()
  19. TARDIS:createWire(entity(),"XYZ", "XYZ")
  20. Owner=TARDIS:owner()
  21. Target=Owner
  22. #entity():setAlpha(0)
  23. Secure=0
  24. Paradox=0
  25. Autospin=0
  26. Calling=0
  27. CallMsg=""
  28. HealthDetect=0
  29. Destruct=0
  30. DestructRun=0
  31. InLoop=0
  32.  
  33. DoOnce2=0
  34. DoOnce4=0
  35.  
  36. #---EP1 Death stuff
  37. DeathCheck=0
  38. EpModeAware=0
  39. EpMode=1
  40. Checked=0
  41.  
  42. #--Companion System----------------
  43. BuddySystem=0
  44. AwaitingResponse=0
  45. Buddy=Holo
  46.  
  47. #BuddyTrust=20
  48. #OwnerTrust=75
  49.  
  50. #--Landing Lights Stuff------------
  51.  
  52. TimeCounter=0
  53. TimeDistort=0
  54. Mass=TARDIS:mass()
  55. LandingLights=0
  56. Force=0
  57. LandingLightsLanding=0
  58.  
  59. #holoCreate(10)
  60. #holoAng(10,ang(0,0,0))
  61. #holoPos(10,Interior:pos()+vec(-350,140,-120))
  62.  
  63. holoCreate(3)
  64. holoModel(3,"models/effects/splodearc.mdl")
  65. holoCreate(4)
  66. holoModel(4,"models/effects/splodearc.mdl")
  67. holoCreate(5)
  68. holoModel(5,"models/effects/splodearc.mdl")
  69.  
  70. holoAlpha(3,0)
  71. holoAlpha(4,0)
  72. holoAlpha(5,0)
  73.  
  74. holoScale(3,vec(0.02,0.02,0.02))
  75. holoScale(4,vec(0.02,0.02,0.02))
  76. holoScale(5,vec(0.02,0.02,0.02))
  77.  
  78. LightPassRandom=random(1,5)
  79. LightPassRandomN=round(LightPassRandom)
  80. if(LightPassRandomN==1){
  81. LightPass="yowzah"
  82. chatPrint(Owner,"Passphrase Hint: Y-WZ-H")
  83. }elseif(LightPassRandomN==2){
  84. LightPass="geronimo"
  85. chatPrint(Owner,"Passphrase Hint: G-R--I-O")
  86. }elseif(LightPassRandomN==3){
  87. LightPass="fantastic"
  88. chatPrint(Owner,"Passphrase Hint: F-NT--T-C")
  89. }elseif(LightPassRandomN==4){
  90. LightPass="doctor"
  91. chatPrint(Owner,"Passphrase Hint: D-CT-R")
  92. }elseif(LightPassRandomN==5){
  93. LightPass="tardis"
  94. chatPrint(Owner,"Passphrase Hint: T-R-IS")
  95. }
  96.  
  97. #--Fuel Stuff-----------------------
  98.  
  99. MaxFuel=1000
  100. Fuel=1000
  101. FuelOn=1
  102. FuelLossFlight=1
  103. FuelLossTeleport=2
  104. FuelLossLeaking=10
  105. FuelPercent=Fuel/MaxFuel*100
  106. round(FuelPercent,1)
  107. Leaking=0
  108. LeakFixSearch=0
  109.  
  110. #--Rift Holo------------------
  111.  
  112. holoCreate(2)
  113. holoModel(2,"models/effects/portalfunnel.mdl")
  114. holoPos(2,TARDIS:pos()+vec(0,0,100))
  115. holoAng(2,TARDIS:toWorld(ang(0,0,0)))
  116. holoColor(2,vec(255,255,255))
  117. holoAlpha(2,0)
  118. holoParent(2,TARDIS)
  119.  
  120. #--Emergency Program 1 holo---
  121. Model=Owner:model()
  122.  
  123. holoCreate(1)
  124. holoModel(1,Model)
  125. holoAnim(1,3)
  126. holoPos(1,Interior:pos())
  127. holoAng(1,ang(0,52,0))
  128. holoAlpha(1,0)
  129. Holo=holoEntity(1)
  130.  
  131. function demat(V:vector){
  132. Success=TARDIS:tardisDemat(V)
  133. if (Success){
  134. chatPrint(Owner,"TARDIS moving.")
  135. }elseif(TARDIS:tardisInVortex()){
  136. if(InLoop==1){
  137. TARDIS:tardisSetDestination(SavePos)
  138. InLoop=0
  139. TimeDistort=0
  140. chatPrint(Owner,"TARDIS destination set.")
  141. }else{
  142. TARDIS:tardisSetDestination(V)
  143. chatPrint(Owner,"TARDIS destination set.")
  144. }
  145. }
  146. }
  147.  
  148. function demat2(V:vector, A:angle){
  149. Success=TARDIS:tardisDemat(V,A)
  150. if (Success){
  151. chatPrint(Owner,"TARDIS moving.")
  152. }elseif(TARDIS:tardisInVortex()){
  153. if(InLoop==1){
  154. TARDIS:tardisSetDestination(SavePos,SaveAng)
  155. InLoop=0
  156. TimeDistort=0
  157. chatPrint(Owner,"TARDIS destination set.")
  158. }else{
  159. TARDIS:tardisSetDestination(V,A)
  160. chatPrint(Owner,"TARDIS destination set.")
  161. }
  162. }
  163. }
  164.  
  165. function vector getEscapePos(){
  166. if (map()=="gm_madgrass_v6"){
  167. return vec(-11270, -6790, -955)
  168. }elseif (map()=="freespace_revolution"){
  169. return vec(840, -12840, -6120)
  170. }elseif (map()=="gm_wot_a5"){
  171. return vec(-8939, 2716, -9199)
  172. }elseif (map()=="gm_freespace_13"){
  173. return vec(-15378.062,12658.719,-15487.5)
  174. }elseif (map()=="gm_warmap_v5"){
  175. return vec(8055.75,-604.594,-13307.719)
  176. }elseif (map()=="gm_flatgrass"){
  177.  
  178. return vec(-1040.031250,48.386456,-12735.968750)
  179. }elseif (map()=="gm_bigcity"){
  180. RandomX = random(9671.929688,10593.456055)
  181. RandomY = random(-8231.812500,-8313.320313)
  182. return vec(RandomX,RandomY,-11135.719)
  183. }elseif(map()=="gm_construct_flatgrass_v6-2"){
  184. return vec(13243.406,2608.781,-887.719)
  185. }elseif(map()=="gm_carcon_ws"){
  186. RandomX = random(193.843170,4071.534424)
  187. RandomY = random(-5884.252930,-6115.213379)
  188. return vec(RandomX,RandomY,-14207.718750)
  189. }elseif(map()=="gm_buildersworld_finalv3"){
  190. RandomX = random(2100.5864257813,3637.1865234375)
  191. RandomY = random(-1158.9822998047,-1226.0826416016)
  192. return vec(RandomX,RandomY,-1143.71875)
  193. }else{
  194. return vec(0,0,0)
  195. }
  196. }
  197.  
  198. function angle getEscapeAng(){
  199. if (map()=="gm_wot_a5"){
  200. return ang(0,-152,0)
  201. }elseif(map()=="gm_warmap_v5"){
  202. return ang(0,180,0)
  203. }elseif(map()=="gm_flatgrass"){
  204. return ang(-0.650574,174.561310,0)
  205. }elseif(map()=="gm_bigcity"){
  206. return ang(0,-90,0)
  207. }elseif(map()=="gm_construct_flatgrass_v6-2"){
  208. return ang(0,90,0)
  209. }elseif(map()=="gm_freespace_13"){
  210. return ang(0,-90,0)
  211. }elseif(map()=="gm_carcon_ws"){
  212. return ang(0,90,0)
  213. }elseif(map()=="gm_buildersworld_finalv3"){
  214. return ang(0,0,0)
  215. }else{
  216. return ang(0,0,0)
  217. }
  218. }
  219. }
  220.  
  221. interval(270)
  222.  
  223. FuelPercent=Fuel/MaxFuel*100
  224. InFlight=TARDIS:tardisFlying()
  225. InTeleport=TARDIS:tardisMoving()
  226. InVortex=TARDIS:tardisInVortex()
  227.  
  228. RPM = abs(TARDIS:angVel():yaw())
  229. Vel=RPM
  230.  
  231. R=R+100*5
  232. R2=R2+150*5
  233. R3=R3+200*5
  234.  
  235. holoAng(6,TARDIS:angles())
  236.  
  237. TardisHp = TARDIS:tardisHealth()
  238. Deaths=Owner:deaths()
  239.  
  240. if(chatClk(Owner)){
  241. LastSaid=Owner:lastSaid():lower():explode(" ")
  242. Cmd=LastSaid[1,string]
  243. Arg=LastSaid[2,string]
  244. Arg2=LastSaid[3,string]
  245.  
  246. if(Cmd=="!target"){
  247. if(LastSaid[2,string]){
  248. Target=findPlayerByName(Arg)
  249. }else{
  250. Target=owner()
  251. }
  252. hideChat(1)
  253. chatPrint(Owner,"Target set to " + Target:name())
  254. }elseif(Cmd=="!go"){
  255. if(Paradox!=1){
  256. if(TimeCounter<1){
  257. local NewPos=Target:pos()
  258. local Yaw=Target:eyeAngles():yaw()
  259. local Offset=150
  260. if(Arg=="up"){
  261. demat(NewPos+Target:up()*Offset)
  262. }elseif(Arg=="forward"){
  263. demat2(NewPos+Target:forward()*Offset, ang(0,Yaw+180,0))
  264. }elseif(Arg=="back"){
  265. demat2(NewPos+Target:forward()*-Offset, ang(0,Yaw,0))
  266. }elseif(Arg=="down"){
  267. demat(NewPos+Target:up()*-Offset)
  268. }elseif(Arg=="right"){
  269. demat2(NewPos+Target:right()*Offset, ang(0,Yaw+90,0))
  270. }elseif(Arg=="left"){
  271. demat2(NewPos+Target:right()*-Offset, ang(0,Yaw+270,0))
  272. }elseif(Arg=="exact"){
  273. demat2(NewPos,ang(0,Yaw,0))
  274. }elseif(Arg=="playx"){
  275. findByClass("gmod_playx")
  276. PlayX=find()
  277. demat2(PlayX:toWorld(vec(-290,-38,-230)), ang(0,0,0))
  278. }else{
  279. demat2(NewPos+Target:forward()*Offset, ang(0,Yaw+180,0))
  280. }
  281. TimeCounter++
  282. }elseif(Arg=="landinglight"){
  283. if(BuddySystem!=1){
  284. if(Arg2==LightPass){
  285. if(LandingLights==1){
  286. if(TARDIS:tardisFlying()==0){
  287. TARDIS:tardisFlightmode()
  288. }
  289. if(TARDIS:tardisLongflighted()==0){
  290. TARDIS:tardisLongflight()
  291. }
  292. if(TARDIS:tardisPhyslocked()==1){
  293. TARDIS:tardisPhyslock()
  294. }
  295. Autospin=0
  296. Secure=0
  297. if(InLoop==0){
  298. demat2(LandingLight1:pos()+vec(0,0,20),ang(0,0,0))
  299. }elseif(InLoop==1){
  300. TARDIS:tardisSetDestination(LandingLight2:pos()+vec(0,0,20),ang(0,0,0))
  301. LandingLightReturn=1
  302. }
  303. chatPrint(Owner,"You have successfully retrieved the landing light passphrase. TARDIS locking on!")
  304. LandingLightsLanding=1
  305. timer("landinglightsmat",16000)
  306. }elseif(LandingLights==0){
  307. if(TARDIS:tardisFlying()==0){
  308. TARDIS:tardisFlightmode()
  309. }
  310. if(TARDIS:tardisLongflighted()==0){
  311. TARDIS:tardisLongflight()
  312. }
  313. if(TARDIS:tardisPhyslocked()==1){
  314. TARDIS:tardisPhyslock()
  315. }
  316. Autospin=0
  317. Secure=0
  318. if(InLoop==0){
  319. demat2(LandingLight1:pos()+vec(0,0,20),ang(0,0,0))
  320. }elseif(InLoop==1){
  321. TARDIS:tardisSetDestination(LandingLight1:pos()+vec(0,0,20),ang(0,0,0))
  322. LandingLightReturn=1
  323. }
  324. chatPrint(Owner,"You have successfully retrieved the landing light passphrase. TARDIS locking on!")
  325. LandingLightsLanding=1
  326. timer("landinglightsmat",16000)
  327. }
  328. }elseif(Arg2!=LightPass){
  329. chatPrint(Owner,"You have used an incorrect passphrase! The TARDIS could not lock onto a landing light")
  330. }
  331. }elseif(BuddySystem==1){
  332. chatPrint(Owner,"You cannot use this function when buddy system is enabled.")
  333. }
  334. }else{
  335. if(TARDIS:tardisLocked()==0){
  336. TARDIS:tardisLock()
  337. }
  338. if(TARDIS:tardisLongflighted()==1){
  339. TARDIS:tardisLongflight()
  340. }
  341. chatPrint(Owner,"Your use of the TARDIS has accumulated too many temporal distortions. Landing lights are needed to lock onto the person.")
  342. SavePos=TARDIS:pos()
  343. SaveAng=TARDIS:angles()
  344. local NewPos=Target:pos()
  345. local Yaw=Target:eyeAngles():yaw()
  346. local Offset=150
  347. if(Arg=="up"){
  348. demat(NewPos+Target:up()*Offset)
  349. }elseif(Arg=="forward"){
  350. demat2(NewPos+Target:forward()*Offset, ang(0,Yaw+180,0))
  351. }elseif(Arg=="back"){
  352. demat2(NewPos+Target:forward()*-Offset, ang(0,Yaw,0))
  353. }elseif(Arg=="down"){
  354. demat(NewPos+Target:up()*-Offset)
  355. }elseif(Arg=="right"){
  356. demat2(NewPos+Target:right()*Offset, ang(0,Yaw+90,0))
  357. }elseif(Arg=="left"){
  358. demat2(NewPos+Target:right()*-Offset, ang(0,Yaw+270,0))
  359. }elseif(Arg=="exact"){
  360. demat2(NewPos,ang(0,Yaw,0))
  361. }elseif(Arg=="playx"){
  362. findByClass("gmod_playx")
  363. PlayX=find()
  364. demat2(PlayX:toWorld(vec(-290,-38,-230)), ang(0,0,0))
  365. }else{
  366. demat2(NewPos+Target:forward()*Offset, ang(0,Yaw+180,0))
  367. }
  368. TimeDistort=1
  369. }
  370. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot teleport while a paradox is taking place.")}
  371. hideChat(1)
  372. }elseif(Cmd=="!escape"){
  373. if(Paradox!=1){
  374. demat2(getEscapePos(),getEscapeAng())
  375. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot teleport while a paradox is taking place.")}
  376. hideChat(1)
  377. }elseif(Cmd=="!cloak"){
  378. if(Paradox!=1){
  379. local Success=TARDIS:tardisPhase()
  380. if (Success==1){
  381. if(TARDIS:tardisVisible()){
  382. chatPrint(Owner,"TARDIS now visible.")
  383. }else{
  384. chatPrint(Owner,"TARDIS no longer visible.")
  385. }
  386. }
  387. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot phase while a paradox is taking place.")}
  388. hideChat(1)
  389. }elseif(Cmd=="!flightmode"){
  390. if(Paradox!=1){
  391. local Success=TARDIS:tardisFlightmode()
  392. if (Success==1){
  393. if(TARDIS:tardisFlying()){
  394. chatPrint(Owner,"TARDIS now flying.")
  395. }else{
  396. chatPrint(Owner,"TARDIS no longer flying.")
  397. }
  398. }
  399. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot fly while a paradox is taking place.")}
  400. hideChat(1)
  401. }elseif(Cmd=="!lock"){
  402. local Success=TARDIS:tardisLock()
  403. if (Success==1){
  404. if(TARDIS:tardisLocked()){
  405. chatPrint(Owner,"TARDIS now locked.")
  406. }else{
  407. chatPrint(Owner,"TARDIS no longer locked.")
  408. }
  409. }
  410. hideChat(1)
  411. }elseif(Cmd=="!repair"){
  412. local Success=TARDIS:tardisSelfrepair()
  413. if (Success==1){
  414. if(owner():tardisGet()!=TARDIS){
  415. if(TARDIS:tardisSelfrepairing()){
  416. chatPrint(Owner,"TARDIS self-repair initiated.")
  417. }else{
  418. chatPrint(Owner,"TARDIS self-repair cancelled.")
  419. }
  420. }
  421. }else{
  422. chatPrint(Owner,"ERROR: TARDIS may be at full health or already repairing.")
  423. }
  424. hideChat(1)
  425. }elseif(Cmd=="!physlock"){
  426. local Success=TARDIS:tardisPhyslock()
  427. if (Success==1){
  428. if(TARDIS:tardisPhyslocked()){
  429. chatPrint(Owner,"TARDIS now phys-locked.")
  430. }else{
  431. chatPrint(Owner,"TARDIS no longer phys-locked.")
  432. }
  433. }
  434. hideChat(1)
  435. }elseif(Cmd=="!power"){
  436. if(Paradox!=1){
  437. local Success=TARDIS:tardisPower()
  438. if (Success==1){
  439. if(TARDIS:tardisPowered()){
  440. chatPrint(Owner,"TARDIS now powered up.")
  441. }else{
  442. chatPrint(Owner,"TARDIS no longer powered up.")
  443. }
  444. }
  445. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot power up while a paradox is taking place.")}
  446. hideChat(1)
  447. }elseif(Cmd=="!isomorph"){
  448. local Success=TARDIS:tardisIsomorph()
  449. if (Success==1){
  450. if(TARDIS:tardisIsomorphic()){
  451. chatPrint(Owner,"TARDIS isomorphic security systems enabled.")
  452. }else{
  453. chatPrint(Owner,"TARDIS isomorphic security systems disabled.")
  454. }
  455. }
  456. hideChat(1)
  457. }elseif(Cmd=="!longflight"){
  458. local Success=TARDIS:tardisLongflight()
  459. if (Success==1){
  460. if(TARDIS:tardisLongflighted()){
  461. chatPrint(Owner,"TARDIS long-flight enabled.")
  462. }else{
  463. chatPrint(Owner,"TARDIS long-flight disabled.")
  464. }
  465. }
  466. hideChat(1)
  467. }elseif(Cmd=="!save"){
  468. SavePos=TARDIS:pos()
  469. SaveAng=TARDIS:angles()
  470. XYZ=SavePos
  471. chatPrint(Owner,"Position saved.")
  472. hideChat(1)
  473. }elseif(Cmd=="!restore"){
  474. demat2(SavePos,SaveAng)
  475. hideChat(1)
  476. }elseif(Cmd=="!back"){
  477. if(Paradox!=1){
  478. TARDIS:tardisFastReturn()
  479. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot teleport while a paradox is taking place.")}
  480. hideChat(1)
  481. }elseif(Cmd=="!health"){
  482. chatPrint(Owner,"TARDIS Health: " + TARDIS:tardisHealth() + "%")
  483. hideChat(1)
  484. }elseif(Cmd=="!mat"){
  485. if(InLoop==1){
  486. TARDIS:tardisSetDestination(SavePos,SaveAng)
  487. chatPrint(Owner,"TARDIS materialising.")
  488. InLoop=0
  489. TimeDistort=0
  490. TARDIS:tardisMaterialise()
  491. }else{
  492. chatPrint(Owner,"TARDIS materialising.")
  493. TARDIS:tardisMaterialise()
  494. }
  495. hideChat(1)
  496. }elseif(Cmd=="!demat"){
  497. TARDIS:tardisFastDemat()
  498. hideChat(1)
  499. }elseif(Cmd=="!secure"){
  500. if(Paradox!=1){
  501. if(Calling==0){
  502. if(Arg=="1"){
  503. if(TARDIS:tardisPowered()==1){
  504. if(TARDIS:tardisFlying()==0){
  505. if(Secure==0 | Secure==2){
  506. if(SecureMemory==1){
  507. SecureMemory=0
  508. }
  509. Secure = 1
  510. holoPos(1,Interior:pos())
  511. holoAlpha(1,0)
  512. chatPrint(Owner,"Secure Mode 1 Activated")
  513. }
  514. }else{
  515. chatPrint(Owner,"Secure Mode 1 cannot be active during flight")
  516. }
  517. }
  518. }
  519. elseif(Arg=="2"){
  520. if(TARDIS:tardisPowered()==1){
  521. if(TARDIS:tardisFlying()==0){
  522. if(Secure==0 | Secure==1){
  523. if(SecureMemory==1){
  524. SecureMemory=0
  525. }
  526. Secure = 2
  527. if(TARDIS:tardisVisible()==0){
  528. TARDIS:tardisPhase()
  529. }
  530. holoPos(1,TARDIS:toWorld(vec(100,0,0)))
  531. holoAlpha(1,0)
  532. holoAng(1,TARDIS:angles())
  533. chatPrint(Owner,"Secure Mode 2 Activated")
  534. }
  535. }else{
  536. chatPrint(Owner,"Secure Mode 2 cannot be active during flight")
  537. }
  538. }
  539. }elseif(Arg=="off"){
  540. Secure=0
  541. holoPos(1,Interior:pos())
  542. holoAlpha(1,0)
  543. chatPrint(Owner,"Secure Mode De-activated")
  544. if(TARDIS:tardisLocked()==1){
  545. TARDIS:tardisLock()
  546. }
  547. if(TARDIS:tardisVisible()==0){
  548. TARDIS:tardisPhase()
  549. }
  550. if(TARDIS:tardisPhyslocked()==1){
  551. TARDIS:tardisPhyslock()
  552. }
  553. if(TARDIS:tardisIsomorphic()==1){
  554. TARDIS:tardisIsomorph()
  555. }
  556. }elseif(Arg==""){
  557. chatPrint(Owner,"You must state which secure mode you would like to use. !secure 1/2/off - Select one of these and place after !secure.")
  558. }
  559. }elseif(Calling==1){
  560. chatPrint(Owner,"You cannot use Secure Mode 2 when your Visual Interface is busy calling someone.")
  561. }
  562. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot activate secure mode while a paradox is taking place.")}
  563. hideChat(1)
  564. }elseif(Cmd=="!ep1"){
  565. if(Paradox!=1){
  566. if(Secure!=2){
  567. if(EpMode==1){
  568. if(TARDIS:tardisPowered()==1){
  569. if(Program1==0){
  570. Program1=1
  571. }else{
  572. Program1=0
  573. }
  574. if(Program1==1){
  575. if(TARDIS:tardisLongflighted()==0){
  576. TARDIS:tardisLongflight()
  577. }else{}
  578. if(TARDIS:tardisIsomorphic()==0){
  579. TARDIS:tardisIsomorph()
  580. }else{}
  581. if(TARDIS:tardisLocked()==0){
  582. TARDIS:tardisLock()
  583. }else{}
  584. EscapePos=1
  585. Secure=0
  586. demat2(getEscapePos(),getEscapeAng())
  587. timer("teleportwait",5000)
  588. }
  589. }
  590. }elseif(EpMode==2){
  591. if(DeathCheck==0){
  592. DeathCheck=1
  593. timer("deathcheck",1000)
  594. chatPrint(Owner,"Emergency Program 1 Death Detection system enabled.")
  595. }elseif(DeathCheck==1){
  596. DeathCheck=0
  597. stoptimer("deathcheck")
  598. chatPrint(Owner,"Emergency Program 1 Death Detection system disabled.")
  599. }
  600. }
  601. }elseif(Secure==2){chatPrint(Owner,"You cannot use Emergency Program 1 as the Visual Interface is busy guarding your TARDIS.")}
  602. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot teleport while a paradox is taking place.")}
  603. hideChat(1)
  604. }elseif(Cmd=="!epmode"){
  605. if(Arg=="1"){
  606. EpMode=1
  607. chatPrint(Owner,"Emergency Program 1 Mode: "+EpMode)
  608. }elseif(Arg=="2"){
  609. EpMode=2
  610. chatPrint(Owner,"Emergency Program 1 Mode: "+EpMode)
  611. }
  612. hideChat(1)
  613. }elseif(Cmd=="!refuel"){
  614. if(FuelOn==1){
  615. if(TARDIS:tardisFlying()!=1){
  616. if(TARDIS:tardisMoving()!=1){
  617. if(Paradox!=1){
  618. if(Fuel==1000){
  619. chatPrint(Owner,"The TARDIS is already at "+FuelPercent+"% fuel.")
  620. }else{
  621. Refuelling=1
  622. RefuelTime=MaxFuel-Fuel
  623. RefuelTimeTotal=RefuelTime*1000
  624. RefuelTimeTotalRandom=RefuelTimeTotal/10000
  625. holoColor(2,vec(0,200,0))
  626. holoAlpha(2,255)
  627. chatPrint(Owner,RefuelTimeTotal/10000+" seconds.")
  628. chatPrint(Owner,"Refuelling the TARDIS")
  629. if(TARDIS:tardisPowered()==1){
  630. TARDIS:tardisPower()
  631. }
  632. TARDIS:soundPlay(10,75,"ambient/machines/teleport3.wav")
  633. Interior:soundPlay(11,75,"ambient/machines/teleport3.wav")
  634. timer("refuel",RefuelTimeTotal/10)
  635. RefuelRandom1=random(1,RefuelTimeTotalRandom/4)
  636. RefuelRandom2=round(RefuelRandom1)
  637. timer("paradoxrandom",RefuelRandom2*1000)
  638. }
  639. }else{
  640. chatPrint(Owner,"The TARDIS could not detect the space-time rift.")
  641. }
  642. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot refuel while a paradox is taking place.")}
  643. }
  644. }
  645. hideChat(1)
  646. }elseif(Cmd=="!fueltoggle"){
  647. if(Paradox!=1){
  648. if(FuelOn==0){
  649. FuelOn=1
  650. chatPrint(Owner,"Fuel System Enabled")
  651. }else{
  652. FuelOn=0
  653. chatPrint(Owner,"Fuel System Disabled")
  654. }
  655. }elseif(Paradox==1){chatPrint(Owner,"The fuel system cannot be toggled during a paradox!")}
  656. hideChat(1)
  657. }elseif(Cmd=="!fuel"){
  658. chatPrint(Owner,FuelPercent+"% Fuel.")
  659. hideChat(1)
  660. }elseif(Cmd=="!help"){
  661. chatPrint(Owner,"This is a list of all the additional commands Cookiemorph added to the TARDIS E2. It works only on gm_carcon_ws and gm_bigcity so far.")
  662. chatPrint(Owner,"!ep1 - This will enable Emergency Program One. If Mode 2 is active, then the TARDIS will only activate EP1 once the TARDIS Owner dies.")
  663. chatPrint(Owner,"!epmode 1/2 - This will change the ep mode. 1 = Normal Mode. 2 = Death mode; If TARDIS owner dies, EP1 activates.")
  664. chatPrint(Owner,"!secure 1/2/off - This will interact with secure mode. 1 = Complete Lockdown, 2 = Visual Interface Guard.")
  665. chatPrint(Owner,"!fueltoggle - This will enable the fuel usage system.")
  666. chatPrint(Owner,"!refuel - This will refuel the TARDIS")
  667. chatPrint(Owner,"!fuel - Displays current fuel level.")
  668. chatPrint(Owner,"!call playername - This will send a Visual Interface call to the specified player, telling them to find your TARDIS.")
  669. chatPrint(Owner,"!landinglight - This will create a landing light and will generate a random who related passphrase with it. They are iconic and easy to guess. Geronimo!")
  670. chatPrint(Owner,"!go landinglight passphrase - This will take you to the landinglight you have spawned. You will need to correctly guess the passphrase for it to teleport.")
  671. chatPrint(Owner,"!autospin 1/2/off - This will interact with the autospin feature. 1 = Anti-clockwise, 2 = Clockwise.")
  672. chatPrint(Owner,"!buddy playername - This will enable the companion system for use with landing lights. To disable, do !buddy")
  673. chatPrint(Owner,"!destruct - This will self destruct the TARDIS.")
  674. hideChat(1)
  675. }elseif(Cmd=="!track"){
  676. local TrackEnt=owner():aimEntity()
  677. if (Arg=="me"){TrackEnt=owner()}
  678. if (Arg=="off"){TrackEnt=noentity()}
  679. local Success=TARDIS:tardisTrack(TrackEnt)
  680. if (Success==1){
  681. if (TARDIS:tardisTracking():isValid()){
  682. chatPrint(Owner,"TARDIS tracking entity set.")
  683. }else{
  684. chatPrint(Owner,"TARDIS tracking disabled.")
  685. }
  686. }
  687. hideChat(1)
  688. }elseif(Cmd=="!spinmode"){
  689. if(Arg==""){Arg="-1"}
  690. local Spinmode=TARDIS:tardisSpinmode(Arg:toNumber())
  691. local SpinmodeS=""
  692. if (Spinmode==-1){SpinmodeS="anti-clockwise"}
  693. if (Spinmode==0){SpinmodeS="none"}
  694. if (Spinmode==1){SpinmodeS="clockwise"}
  695. chatPrint(Owner,"TARDIS Spinmode set to: " + SpinmodeS + ".")
  696. hideChat(1)
  697. }elseif(Cmd=="!empty"){
  698. if(Owner:steamID()=="STEAM_0:1:7149885"){
  699. Fuel = 20
  700. hideChat(1)
  701. chatPrint(Owner,"Emptying fuel!")
  702. }else{
  703. chatPrint(Owner,"You need to be Cookiemorph to use this command!")
  704. }
  705. }elseif(Cmd=="!pilot"){
  706. if(TARDIS:tardisPilot():isValid()){
  707. chatPrint(Owner,"TARDIS pilot: " + TARDIS:tardisPilot():name())
  708. }else{
  709. chatPrint(Owner,"TARDIS has no current pilot.")
  710. }
  711. }elseif(Cmd=="!hads"){
  712. local Success=TARDIS:tardisHADS()
  713. if (Success){
  714. if (TARDIS:tardisIsHADS()){
  715. chatPrint(Owner,"TARDIS HADS enabled.")
  716. }else{
  717. chatPrint(Owner,"TARDIS HADS disabled.")
  718. }
  719. }
  720. hideChat(1)
  721. }elseif(Cmd=="!call"){
  722. if(Secure==0){
  723. if(LastSaid[2,string]){
  724. Receiver=findPlayerByName(Arg)
  725. }else{
  726. Receiver=owner()
  727. }
  728. if(TARDIS:tardisPowered()==1){
  729. chatPrint(Owner,"Calling "+Receiver:name())
  730. chatPrint(Receiver,"You are being called by "+Owner:name()+"'s TARDIS Visual Interface. Please wait!")
  731. timer("callholoplace",5000)
  732. Calling=1
  733. }elseif(TARDIS:tardisPowered()==0){
  734. chatPrint(Owner,"You cannot make a Visual Interface call when the TARDIS is powered down.")
  735. }
  736. }elseif(Secure==2){
  737. chatPrint(Owner,"You cannot make a Visual Interface Call when the Visual Interface is guarding your TARDIS!")
  738. }
  739. hideChat(1)
  740. }elseif(Cmd=="!landinglight"){
  741. LandingLightN=random(1,3)
  742. LandingLightN1=round(LandingLightN)
  743. if(LandingLightN1==1){
  744. LandingLightModel="models/props_combine/breenbust.mdl"
  745. }elseif(LandingLightN1==2){
  746. LandingLightModel="models/props_combine/breenglobe.mdl"
  747. }elseif(LandingLightN1==3){
  748. LandingLightModel="models/props_junk/plasticbucket001a.mdl"
  749. }
  750. if(LandingLights==0){
  751. if(BuddySystem==0){
  752. if(Target!=Owner){
  753. LandingLight1=propSpawn(LandingLightModel,Target:toWorld(vec(100,0,30)),1)
  754.  
  755. LandingLights=0
  756. chatPrint(Owner,"New landing light created at target: "+Target:name())
  757. }else{
  758. LandingLight1=propSpawn(LandingLightModel,Owner:aimPos(),1)
  759.  
  760. LandingLights=0
  761. chatPrint(Owner,"New landing light created")
  762. }
  763. }
  764. elseif(BuddySystem==1){
  765. LandingLight1=propSpawn(LandingLightModel,Buddy:toWorld(vec(100,0,30)),1)
  766.  
  767. LandingLights=1
  768. AwaitingResponse=1
  769. chatPrint(Owner,"New landing light created at "+Buddy:name()+". Awaiting response from "+Buddy:name())
  770. chatPrint(Buddy,Owner:name()+" has created a landing light. Call it using the passphrase "+LightPass)
  771. }
  772. }elseif(LandingLights==1){
  773. if(BuddySystem==0){
  774. if(Target!=Owner){
  775. LandingLight2=propSpawn(LandingLightModel,Target:toWorld(vec(100,0,30)),1)
  776.  
  777. LandingLights=0
  778. chatPrint(Owner,"New landing light created at target: "+Target:name())
  779. }else{
  780. LandingLight2=propSpawn(LandingLightModel,Owner:aimPos(),1)
  781.  
  782. LandingLights=0
  783. chatPrint(Owner,"New landing light created")
  784. }
  785. }
  786. elseif(BuddySystem==1){
  787. LandingLight2=propSpawn(LandingLightModel,Buddy:toWorld(vec(100,0,30)),1)
  788.  
  789. LandingLights=0
  790. AwaitingResponse=1
  791. chatPrint(Owner,"New landing light created at "+Buddy:name()+". Awaiting response from "+Buddy:name())
  792. chatPrint(Buddy,Owner:name()+" has created a landing light. Call it using the passphrase "+LightPass)
  793. }
  794. }
  795. hideChat(1)
  796. }elseif(Cmd=="!autospin"){
  797. if(Arg=="1"){
  798. Autospin=1
  799. chatPrint(Owner,"Autospinning anti-clockwise")
  800. }elseif(Arg=="2"){
  801. Autospin=2
  802. chatPrint(Owner,"Autospinning clockwise")
  803. }elseif(Arg=="off"){
  804. Autospin=0
  805. chatPrint(Owner,"Autospinning de-activated")
  806. }elseif(Arg==""){
  807. Autospin=0
  808. chatPrint(Owner,"Autospinning de-activated")
  809. }
  810. hideChat(1)
  811. }elseif(Cmd=="!destruct"){
  812. if(Paradox!=1){
  813. chatPrint(Owner,"TARDIS Self Destruct Sequence Initiated - destruction process starting in 5 seconds.")
  814. timer("paradox1",5000)
  815. if(TARDIS:tardisPowered()==1){
  816. TARDIS:tardisPower()
  817. }
  818. Destruct=1
  819. if(TardisHp>=90 & TardisHp<=100){
  820. DestructRun=0
  821. #print(DestructRun)
  822. }elseif(TardisHp>=50 & TardisHp<90){
  823. DestructRun=1
  824. #print(DestructRun)
  825. }elseif(TardisHp>=20 & TardisHp<50){
  826. DestructRun=2
  827. #print(DestructRun)
  828. }elseif(TardisHp>0 & TardisHp<20){
  829. DestructRun=3
  830. #print(DestructRun)
  831. }
  832. }elseif(Paradox==1){
  833. chatPrint(Owner,"The TARDIS cannot self destruct during a paradox!")
  834. }
  835. hideChat(1)
  836. }elseif(Cmd=="!buddy"){
  837. if(LastSaid[2,string]){
  838. Buddy=findPlayerByName(Arg)
  839. BuddySystem=1
  840. #timer("buddytrust",60000)
  841. chatPrint(Owner,"Companion System enabled. "+Buddy:name()+" is now your companion.")
  842. chatPrint(Buddy,"You are now "+Owner:name()+"'s TARDIS companion.")
  843. }else{
  844. #stoptimer("buddytrust")
  845. BuddySystem=0
  846. chatPrint(Buddy,"You are no longer "+Owner:name()+"'s TARDIS companion.")
  847. chatPrint(Owner,Buddy:name()+" is no longer your companion. The companion system has been disabled.")
  848. Buddy=Holo
  849. }
  850. hideChat(1)
  851. }
  852.  
  853. }
  854.  
  855. if(BuddySystem==1){
  856. BS=Buddy:lastSaid():lower()
  857. if(chatClk(Buddy)){
  858. BSaid=BS:explode(" ")
  859. Said=BuddySaid[1,string]
  860.  
  861. if(BS:find(LightPass) & AwaitingResponse==1){
  862. if(BuddySystem==1){
  863. if(LandingLights==1){
  864. if(TARDIS:tardisFlying()==0){
  865. TARDIS:tardisFlightmode()
  866. }
  867. if(TARDIS:tardisLongflighted()==0){
  868. TARDIS:tardisLongflight()
  869. }
  870. if(TARDIS:tardisPhyslocked()==1){
  871. TARDIS:tardisPhyslock()
  872. }
  873. Autospin=0
  874. Secure=0
  875. TimeDistort=0
  876. demat2(LandingLight1:pos()+vec(0,0,20),ang(0,0,0))
  877. LandingLightsLanding=1
  878. AwaitingResponse=0
  879. chatPrint(Owner,Buddy:name()+" has successfully retrieved the landing light passphrase. TARDIS locking on!")
  880. chatPrint(Owner,"You have successfully retrieved the landing light passphrase. "+Owner:name()+"'s TARDIS locking on!")
  881. timer("landinglightsmat",16000)
  882. }elseif(LandingLights==0){
  883. if(TARDIS:tardisFlying()==0){
  884. TARDIS:tardisFlightmode()
  885. }
  886. if(TARDIS:tardisLongflighted()==0){
  887. TARDIS:tardisLongflight()
  888. }
  889. if(TARDIS:tardisPhyslocked()==1){
  890. TARDIS:tardisPhyslock()
  891. }
  892. Autospin=0
  893. Secure=0
  894. TimeDistort=0
  895. demat2(LandingLight2:pos()+vec(0,0,20),ang(0,0,0))
  896. LandingLightsLanding=1
  897. AwaitingResponse=0
  898. chatPrint(Owner,Buddy:name()+" has successfully retrieved the landing light passphrase. TARDIS locking on!")
  899. chatPrint(Buddy,"You have successfully retrieved the landing light passphrase. "+Owner:name()+"'s TARDIS locking on!")
  900. timer("landinglightsmat",16000)
  901. }
  902. }elseif(BuddySystem==0){chatPrint(Buddy,"You cannot use this function when companion system is disabled.")}
  903. }
  904. }
  905. }
  906.  
  907.  
  908. #-Destruct Shit-------------------------------------------------
  909. if(Destruct==1){
  910. if(TARDIS:tardisPowered()==1){
  911. TARDIS:tardisPower()
  912. }
  913. }
  914.  
  915. #-----Time Distortion shit--------------------------------------------------------
  916.  
  917. if(TimeDistort==1 & LandingLightReturn==0){
  918. if(TARDIS:tardisMoving()==1){
  919. Teleporting=1
  920. }
  921. }
  922.  
  923. if(Teleporting==1){
  924. if(TARDIS:tardisMoving()==0){
  925. if(TARDIS:tardisLongflighted()==0){
  926. TARDIS:tardisLongflight()
  927. }
  928. TARDIS:tardisFastDemat()
  929. Teleporting=0
  930. Inloop=1
  931. }
  932. }
  933.  
  934. #--Exterior Cloister-------------------------------------------------------------------------------
  935.  
  936. findByClass("player")
  937. findIncludePlayer(Owner)
  938. Player2=find()
  939.  
  940. Dist2=Player2:pos():distance(TARDIS:pos())
  941.  
  942. if(Dist2<1000){
  943. if(TardisHp<=20){
  944. if(DoOnce2==0){
  945. timer("cloister",0)
  946. DoOnce2=1
  947. }
  948. }elseif(TardisHp>20){
  949. soundStop(1)
  950. DoOnce2=0
  951. }
  952. }elseif(Dist2>1500){
  953. if(TardisHp<=20){
  954. DoOnce2=0
  955. soundStop(1)
  956. }
  957. }
  958.  
  959.  
  960. if(clk("cloister")){
  961. TARDIS:soundPlay(1,100,"tardis/cloisterbell_loop.wav")
  962. }
  963.  
  964. #------Full Repair Skin Change-----------------------------------
  965. if(TardisHp==0){
  966. HealthDetect=1
  967. }
  968.  
  969. if(HealthDetect==1){
  970. if(TardisHp==100){
  971. timer("repairskinchange",0)
  972. }
  973. }
  974.  
  975. if(clk("repairskinchange")){
  976. TARDIS:setSkin(randint(0,3))
  977. HealthDetect=0
  978. }
  979.  
  980. #----Autospin--------------------------------
  981. if(InFlight==1){
  982. if(Autospin==1){
  983. TARDIS:applyAngForce(ang(0,Mass*35,0))
  984. }elseif(Autospin==2){
  985. TARDIS:applyAngForce(ang(0,-Mass*35,0))
  986. }elseif(Autospin==0){}
  987. }
  988.  
  989. #----Landing Light Rotation
  990.  
  991. if(Force==1){
  992. TARDIS:applyAngForce(ang(0,Mass*100,0))
  993. holoScale(3,vec(Vel/500,Vel/500,Vel/500))
  994. holoScale(4,vec(Vel/500,Vel/500,Vel/500))
  995. holoScale(5,vec(Vel/500,Vel/500,Vel/500))
  996. }elseif(Force==2){
  997. TARDIS:applyAngForce(ang(0,-Mass*100,0))
  998. holoScale(3,vec(Vel/500,Vel/500,Vel/500))
  999. holoScale(4,vec(Vel/500,Vel/500,Vel/500))
  1000. holoScale(5,vec(Vel/500,Vel/500,Vel/500))
  1001. }elseif(Force==0){}
  1002.  
  1003. ##------Landing Lights Stuff-------------------------------------
  1004. if(LandingLightsLanding==1){
  1005. holoAng(3,TARDIS:angles()+ang(R,R,0))
  1006. holoAng(4,TARDIS:angles()+ang(R2,0,R2))
  1007. holoAng(5,TARDIS:angles()+ang(0,R3,R3))
  1008. }
  1009.  
  1010. holoPos(3,TARDIS:toWorld(vec(0,0,50)))
  1011. holoPos(4,TARDIS:toWorld(vec(0,0,50)))
  1012. holoPos(5,TARDIS:toWorld(vec(0,0,50)))
  1013.  
  1014. if(clk("landinglightsmat")){
  1015. if(TARDIS:tardisInVortex()==1){
  1016. TARDIS:tardisMaterialise()
  1017. }
  1018. if(TARDIS:tardisPhyslocked()==1){
  1019. TARDIS:tardisPhyslock()
  1020. }
  1021. if(TARDIS:tardisLocked()==1){
  1022. TARDIS:tardisLock()
  1023. }
  1024. InLoop=0
  1025. Teleporting=0
  1026. TimeDistort=0
  1027. TimeCounter=0
  1028. LandingLightReturn=0
  1029. #print(InLoop+","+Teleporting+","+TimeDistort+","+TimeCounter)
  1030. Force=1
  1031. timer("landinglightsholo",9000)
  1032. }
  1033. if(clk("landinglightsholo")){
  1034. holoAlpha(3,80)
  1035. holoAlpha(4,80)
  1036. holoAlpha(5,80)
  1037. timer("landinglightsholo2",4000)
  1038. }
  1039. if(clk("landinglightsholo2")){
  1040. holoAlpha(3,160)
  1041. holoAlpha(4,160)
  1042. holoAlpha(5,160)
  1043. timer("landinglightsholo3",1000)
  1044. Force=2
  1045. }
  1046. if(clk("landinglightsholo3")){
  1047. holoAlpha(3,255)
  1048. holoAlpha(4,255)
  1049. holoAlpha(5,255)
  1050. timer("landinglightsending",7000)
  1051. }
  1052. if(clk("landinglightsending")){
  1053. if(TARDIS:tardisFlying()==1){
  1054. TARDIS:tardisFlightmode()
  1055. }
  1056. if(TARDIS:tardisLongflighted()==1){
  1057. TARDIS:tardisLongflight()
  1058. }
  1059. LandingLightsLanding=0
  1060. holoScale(3,vec(0.02,0.02,0.02))
  1061. holoScale(4,vec(0.02,0.02,0.02))
  1062. holoScale(5,vec(0.02,0.02,0.02))
  1063. holoAlpha(3,0)
  1064. holoAlpha(4,0)
  1065. holoAlpha(5,0)
  1066. TARDIS:soundPlay(4,200,"ambient/explosions/explode_7.wav")
  1067. Force=0
  1068. if(LandingLights==0){
  1069. LandingLight1:propDelete()
  1070. }elseif(LandingLights==1){
  1071. LandingLight2:propDelete()
  1072. }
  1073. AwaitingResponse=0
  1074. }
  1075.  
  1076.  
  1077. ##------Voice Interface Call-------------------------------------
  1078. if(clk("callholoplace")){
  1079. holoPos(1,Receiver:toWorld(vec(100,0,0)))
  1080. holoAng(1,Receiver:angles()+ang(0,180,0))
  1081. timer("holofade1",300)
  1082. }
  1083. if(clk("holofade1")){
  1084. holoAlpha(1,60)
  1085. Holo:soundPlay(2,50,"buttons/button1.wav")
  1086. timer("holofade2",300)
  1087. }
  1088. if(clk("holofade2")){
  1089. holoAlpha(1,120)
  1090. timer("holofade3",300)
  1091. }
  1092. if(clk("holofade3")){
  1093. holoAlpha(1,180)
  1094. Holo:soundPlay(2,50,"buttons/button1.wav")
  1095. timer("holofade4",300)
  1096. }
  1097. if(clk("holofade4")){
  1098. holoAlpha(1,240)
  1099. timer("holofade5",300)
  1100. }
  1101. if(clk("holofade5")){
  1102. holoAlpha(1,255)
  1103. timer("tardiscall",300)
  1104. }
  1105. if(clk("tardiscall")){
  1106. holoAlpha(1,255)
  1107. chatPrint(Receiver,"TARDIS VISUAL INTERFACE: Come to "+Owner:name()+"'s TARDIS for an adventure!")
  1108. chatPrint(Owner,Receiver:name()+" has received your TARDIS Visual Interface call.")
  1109. timer("tardiscallend",5000)
  1110. }
  1111. if(clk("tardiscallend")){
  1112. holoAlpha(1,240)
  1113. timer("tardiscallend2",300)
  1114. }
  1115. if(clk("tardiscallend2")){
  1116. holoAlpha(1,180)
  1117. timer("tardiscallend3",300)
  1118. }
  1119. if(clk("tardiscallend3")){
  1120. holoAlpha(1,120)
  1121. timer("tardiscallend4",300)
  1122. }
  1123. if(clk("tardiscallend4")){
  1124. holoAlpha(1,60)
  1125. timer("tardiscallend5",300)
  1126. }
  1127. if(clk("tardiscallend5")){
  1128. holoAlpha(1,0)
  1129. holoPos(1,Interior:pos())
  1130. Holo:soundPlay(3,50,"buttons/button18.wav")
  1131. Calling=0
  1132. chatPrint(Owner,"The TARDIS Visual Interface has finished sending your call.")
  1133. }
  1134.  
  1135. ##------Emergency Program 1 stuff--------------------------------
  1136.  
  1137. if(clk("deathcheck")){
  1138. if(DeathCheck==1){
  1139. CurDeaths=Deaths
  1140. #chatPrint(Owner,"CurDeaths saved as "+CurDeaths)
  1141. timer("deathcheck",1000)
  1142. Checked=1
  1143. }
  1144. }
  1145.  
  1146. if(Deaths>CurDeaths){
  1147. if(DeathCheck==1 & Checked==1){
  1148. if(DoOnce3==0){
  1149. chatPrint(Owner,"Owner death detected. Emergency Program 1 initiating.")
  1150. stoptimer("deathcheck")
  1151. EpModeAware=1
  1152. DeathCheck=0
  1153. Checked=0
  1154. DoOnce3=1
  1155. EpDo=1
  1156. timer("ep1start2",3000)
  1157. }
  1158. }
  1159. }
  1160.  
  1161. if(clk("ep1start2")){
  1162. if(EpModeAware==1){
  1163. if(EpDo==1){
  1164. if(Paradox!=1){
  1165. if(Secure!=2){
  1166. if(EpMode==2){
  1167. if(TARDIS:tardisPowered()==1){
  1168. if(Program1==0){
  1169. Program1=1
  1170. }else{
  1171. Program1=0
  1172. }
  1173. if(Program1==1){
  1174. if(TARDIS:tardisLongflighted()==0){
  1175. TARDIS:tardisLongflight()
  1176. }else{}
  1177. if(TARDIS:tardisIsomorphic()==0){
  1178. TARDIS:tardisIsomorph()
  1179. }else{}
  1180. if(TARDIS:tardisLocked()==0){
  1181. TARDIS:tardisLock()
  1182. }else{}
  1183. Secure=0
  1184. demat2(getEscapePos(),getEscapeAng())
  1185. timer("teleportwait",5000)
  1186. }
  1187. }
  1188. }
  1189. }elseif(Secure==2){chatPrint(Owner,"You cannot use Emergency Program 1 as the Visual Interface is busy guarding your TARDIS.")}
  1190. }elseif(Paradox==1){chatPrint(Owner,"The TARDIS cannot teleport while a paradox is taking place.")}
  1191. }
  1192. }
  1193. }
  1194.  
  1195. if(clk("teleportwait")){
  1196. if(TARDIS:tardisMoving()==1){
  1197. holoPos(1,Interior:pos()-vec(-60,-80,47))
  1198. holoAng(1,ang(0,52,0))
  1199. timer("Holoappear",19000)
  1200. }
  1201. }
  1202. if(clk("Holoappear")){
  1203. if(Program1==1){
  1204. holoAlpha(1,255)
  1205. Holo:soundPlay(2,50,"buttons/button1.wav")
  1206. timer("message1",1000)
  1207. }else{
  1208. holoAlpha(1,0)
  1209. }
  1210. }
  1211. if(clk("message1")){
  1212. Holo:soundPlay(6,1,"hl1/fvox/warning.wav")
  1213. soundVolume(1,1000)
  1214. timer("message2",1200)
  1215. }
  1216. if(clk("message2")){
  1217. Holo:soundPlay(7,5,"hl1/fvox/near_death.wav")
  1218. soundVolume(2,100)
  1219. timer("Holodisappear",5000)
  1220. }
  1221. if(clk("Holodisappear")){
  1222. Holo:soundPlay(3,50,"buttons/button18.wav")
  1223. holoAlpha(1,0)
  1224. holoPos(1,Interior:pos())
  1225. if(TARDIS:tardisMoving()==1){
  1226. TARDIS:tardisMaterialise()
  1227. }
  1228. timer("landed",20000)
  1229. }
  1230. if(clk("landed")){
  1231. if(TARDIS:tardisLongflighted()==1){
  1232. TARDIS:tardisLongflight()
  1233. }else{}
  1234. if(TARDIS:tardisPowered()==1){
  1235. TARDIS:tardisPower()
  1236. }else{}
  1237. Program1=0
  1238. DoOnce3=0
  1239. EpModeAware=0
  1240. EpDo=0
  1241. }
  1242.  
  1243. ##------Secure Mode Stuff--------------------Fixed Some entity finder stuff- doctor Vendetta---##
  1244. runOnTick(1)
  1245. findInSphere(TARDIS:pos(),5000000)
  1246. findSortByDistance(TARDIS:pos())
  1247. findIncludeClass("player")
  1248. findExcludePlayer(Owner)
  1249.  
  1250. Player = findResult(1)
  1251.  
  1252.  
  1253. Dist = TARDIS:pos():distance(Player:pos())
  1254.  
  1255. if(Secure==1){
  1256. if(Dist<600){
  1257. if(TARDIS:tardisVisible()==1){
  1258. TARDIS:tardisPhase()
  1259. }else{}
  1260. if(TARDIS:tardisPhyslocked()==0){
  1261. TARDIS:tardisPhyslock()
  1262. }else{}
  1263. if(TARDIS:tardisIsomorphic()==0){
  1264. TARDIS:tardisIsomorph()
  1265. }else{}
  1266. if(TARDIS:tardisLocked()==0){
  1267. TARDIS:tardisLock()
  1268. chatPrint(Owner,Player:name()+" has entered the TARDIS vicinity." )
  1269. }else{}
  1270. }elseif(Dist>600){
  1271. if(TARDIS:tardisLocked()==1){
  1272. TARDIS:tardisLock()
  1273. chatPrint(Owner,Player:name()+" has left the TARDIS vicinity.")
  1274. }
  1275. if(TARDIS:tardisVisible()==0){
  1276. TARDIS:tardisPhase()
  1277. }
  1278. if(TARDIS:tardisPhyslocked()==1){
  1279. TARDIS:tardisPhyslock()
  1280. }
  1281. if(TARDIS:tardisIsomorphic()==1){
  1282. TARDIS:tardisIsomorph()
  1283. }
  1284. }
  1285. }
  1286. if(Secure==2){
  1287. if(Dist<350){
  1288. if(TARDIS:tardisPhyslocked()==0){
  1289. TARDIS:tardisPhyslock()
  1290. }
  1291. if(TARDIS:tardisIsomorphic()==0){
  1292. TARDIS:tardisIsomorph()
  1293. }
  1294. if(TARDIS:tardisLocked()==0){
  1295. TARDIS:tardisLock()
  1296. holoPos(1,TARDIS:toWorld(vec(50,0,0)))
  1297. holoAng(1,TARDIS:angles())
  1298. Holo:soundPlay(2,50,"buttons/button1.wav")
  1299. chatPrint(Player,"TARDIS VISUAL INTERFACE: Please leave the vicinity of "+Owner:name()+"'s TARDIS.")
  1300. chatPrint(Owner,Player:name()+" has entered the TARDIS vicinity." )
  1301. }
  1302. holoAlpha(1,255)
  1303. }elseif(Dist>350){
  1304. if(TARDIS:tardisLocked()==1){
  1305. TARDIS:tardisLock()
  1306. holoPos(1,Interior:pos())
  1307. Holo:soundPlay(3,50,"buttons/button18.wav")
  1308. chatPrint(Owner,Player:name()+" has left the TARDIS vicinity.")
  1309. }
  1310. if(TARDIS:tardisPhyslocked()==1){
  1311. TARDIS:tardisPhyslock()
  1312. }
  1313. if(TARDIS:tardisIsomorphic()==1){
  1314. TARDIS:tardisIsomorph()
  1315. }
  1316. holoAlpha(1,0)
  1317. }
  1318. }
  1319.  
  1320. ###---------------Fixed Secure Memory Stuff so it doesnt spam in flight-doctor Vendetta-------###
  1321.  
  1322. if(Secure==1){
  1323. if(InFlight==1 | InTeleport==1 | InVortex==1){
  1324. Secure=0
  1325. SecureMemory=1
  1326. chatPrint(Owner,"Secure Mode 1 De-activated")
  1327. }
  1328. }
  1329. if(Secure==2){
  1330. if(InFlight==1 | InTeleport==1 | InVortex==1){
  1331. Secure=0
  1332. SecureMemory=2
  1333. chatPrint(Owner,"Secure Mode 2 De-activated")
  1334. }
  1335. }
  1336. if(InFlight==0 & InTeleport==0 & InVortex==0){
  1337. if(SecureMemory==1){
  1338. Secure=1
  1339. SecureMemory=0
  1340. chatPrint(Owner,"Secure Mode 1 Re-activated")
  1341. }elseif(SecureMemory==2){
  1342. Secure=2
  1343. SecureMemory=0
  1344. chatPrint(Owner,"Secure Mode 2 Re-activated")
  1345. }else{}
  1346. }
  1347.  
  1348.  
  1349.  
  1350.  
  1351. #--Fuel stuff-------------------------------------------------------------------------------------
  1352.  
  1353. if(FuelOn==1 & TardisHp<10){
  1354. if(DoOnce4==0){
  1355. Leaking=1
  1356. DoOnce4=1
  1357. LeakFixSearch=1
  1358. timer("fuelcounter",1000)
  1359. chatPrint(Owner,"The TARDIS is leaking fuel due to excess damage!")
  1360. }
  1361. }
  1362.  
  1363. if(LeakFixSearch==1){
  1364. if(TardisHp==100){
  1365. Leaking=0
  1366. LeakFixSearch=0
  1367. DoOnce4=0
  1368. chatPrint(Owner,"The TARDIS has stopped leaking fuel.")
  1369. }
  1370. }
  1371.  
  1372. if(FuelOn==1 & InFlight==1){
  1373. timer("fuelcounter",1000)
  1374. }
  1375. if(FuelOn==1 & InTeleport==1){
  1376. timer("fuelcounter",1000)
  1377. }
  1378. #if(FuelOn==1 & InVortex==1){
  1379. # timer("fuelcounter",1000)
  1380. #}
  1381.  
  1382. if(clk("fuelcounter")){
  1383. if(InFlight==1){
  1384. if(Fuel>0){
  1385. Fuel=Fuel-FuelLossFlight
  1386. }
  1387. timer("fuelcounter",1000)
  1388. round(FuelPercent,1)
  1389. }elseif(InTeleport==1){
  1390. if(Fuel>0){
  1391. Fuel=Fuel-FuelLossTeleport
  1392. }
  1393. timer("fuelcounter",1000)
  1394. round(FuelPercent,1)
  1395. }elseif(Leaking==1){
  1396. if(Fuel>0){
  1397. Fuel=Fuel-FuelLossLeaking
  1398. }
  1399. timer("fuelcounter",1000)
  1400. round(FuelPercent,1)
  1401. #}elseif(InVortex==1){
  1402. # if(Fuel!=0){
  1403. # Fuel=Fuel-FuelLossVortex
  1404. # }
  1405. # timer("fuelcounter",1000)
  1406. # round(FuelPercent,1)
  1407. # print("leltest")
  1408. }
  1409. }
  1410.  
  1411. if(Fuel<=0 & InFlight==1){
  1412. TARDIS:tardisFlightmode()
  1413. }
  1414.  
  1415. if(Fuel<=0 & InTeleport==1){
  1416. if(DoOnce==0){
  1417. timer("materialise",100)
  1418. DoOnce=1
  1419. }
  1420. }
  1421. if(clk("materialise")){
  1422. TARDIS:tardisMaterialise()
  1423. timer("matreset",9000)
  1424. chatPrint(Owner,"Fuel cells empty. TARDIS materialising.")
  1425. }
  1426. if(clk("matreset")){
  1427. DoOnce=0
  1428. }
  1429.  
  1430. if(clk("refuel")){
  1431. if(TARDIS:tardisPowered()==0){
  1432. TARDIS:tardisPower()
  1433. }
  1434. Fuel=MaxFuel
  1435. Refuelling=0
  1436. holoAlpha(2,0)
  1437. soundStop(10)
  1438. soundStop(11)
  1439. TARDIS:soundPlay(12,50,"tardis/powerup.wav")
  1440. Interior:soundPlay(13,50,"tardis/powerup.wav")
  1441. round(FuelPercent,1)
  1442. chatPrint(Owner,"Refuelling complete.")
  1443. }
  1444.  
  1445. if(Fuel<=0){
  1446. if(TARDIS:tardisPowered()==1){
  1447. TARDIS:tardisPower()
  1448. }
  1449. }
  1450.  
  1451. if(Refuelling==1){
  1452. if(TARDIS:tardisPowered()==1){
  1453. TARDIS:tardisPower()
  1454. }
  1455. }
  1456. #---Paradox Stuff---------------------------------------------------------------------------------------
  1457.  
  1458. if(Paradox==1){
  1459. if(TARDIS:tardisPowered()==1){
  1460. TARDIS:tardisPower()
  1461. }
  1462. }
  1463. if(clk("paradoxrandom"))
  1464. {
  1465. ParadoxRandom1=random(1,100)
  1466. ParadoxRandom2=round(ParadoxRandom1)
  1467. #print(ParadoxRandom2)#--debug
  1468. timer("paradoxdecision",100)
  1469. }
  1470. if(clk("paradoxdecision"))
  1471. {
  1472. if(ParadoxRandom2<15){
  1473. holoColor(2,vec(255,255,255))
  1474. stoptimer("refuel")
  1475. timer("paradox1",ParadoxRandom2*1000)
  1476. soundStop(10)
  1477. soundStop(11)
  1478. TARDIS:soundPlay(8,100,"ambient/energy/powerdown2.wav")
  1479. Interior:soundPlay(9,100,"ambient/energy/powerdown2.wav")
  1480. chatPrint(Owner,"Warning: Paradox Detected")
  1481. Fuel=0
  1482. Paradox=1
  1483. Secure=0
  1484. Refuelling=0
  1485. }
  1486. }
  1487. if(clk("paradox1")){
  1488. if(Paradox==1 & Destruct==0){
  1489. holoColor(2,vec(255,0,0))
  1490. Explodable1=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()-vec(0,0,150),ang(0,0,0),1)
  1491. Explodable1:setAlpha(0)
  1492. Explodable1:propBreak()
  1493. timer("paradox2",ParadoxRandom2*1000)
  1494. }elseif(Destruct==1 & Paradox==0){
  1495. Explodable1=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()-vec(0,0,150),ang(0,0,0),1)
  1496. Explodable1:setAlpha(0)
  1497. Explodable1:propBreak()
  1498. timer("paradox2",500)
  1499. }
  1500. }
  1501. if(clk("paradox2")){
  1502. if(Paradox==1 & Destruct==0){
  1503. Explodable2=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()-vec(0,0,150),ang(0,0,0),1)
  1504. Explodable2:setAlpha(0)
  1505. Explodable2:propBreak()
  1506. Explodable3=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()+vec(0,0,150),ang(0,0,0),1)
  1507. Explodable3:setAlpha(0)
  1508. Explodable3:propBreak()
  1509. timer("paradox3",ParadoxRandom2*1000)
  1510. }elseif(Destruct==1 & Paradox==0){
  1511. Explodable2=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()-vec(0,0,150),ang(0,0,0),1)
  1512. Explodable2:setAlpha(0)
  1513. Explodable2:propBreak()
  1514. Explodable3=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()+vec(0,0,150),ang(0,0,0),1)
  1515. Explodable3:setAlpha(0)
  1516. Explodable3:propBreak()
  1517. timer("paradox3",500)
  1518. }
  1519. }
  1520. if(clk("paradox3")){
  1521. if(Paradox==1 & Destruct==0){
  1522. Explodable4=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()+vec(0,0,150),ang(0,0,0),1)
  1523. Explodable4:setAlpha(0)
  1524. Explodable4:propBreak()
  1525. Explodable5=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()-vec(0,0,150),ang(0,0,0),1)
  1526. Explodable5:setAlpha(0)
  1527. Explodable5:propBreak()
  1528. Explodable6=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos(),ang(0,0,0),1)
  1529. Explodable6:setAlpha(0)
  1530. Explodable6:propBreak()
  1531. timer("paradoxend",ParadoxRandom2*1000)
  1532. }elseif(Destruct==1 & Paradox==0){
  1533. Explodable4=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()+vec(0,0,150),ang(0,0,0),1)
  1534. Explodable4:setAlpha(0)
  1535. Explodable4:propBreak()
  1536. Explodable5=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos()-vec(0,0,150),ang(0,0,0),1)
  1537. Explodable5:setAlpha(0)
  1538. Explodable5:propBreak()
  1539. Explodable6=propSpawn("models/props_c17/oildrum001_explosive.mdl",Interior:pos(),ang(0,0,0),1)
  1540. Explodable6:setAlpha(0)
  1541. Explodable6:propBreak()
  1542. if(DestructRun<=3){
  1543. timer("paradox1",500)
  1544. DestructRun++
  1545. }else{
  1546. chatPrint(Owner,"Self-Destruction completed.")
  1547. TARDIS:soundPlay(1,500,"ambient/explosions/exp1.wav")
  1548. DestructRun=0
  1549. Destruct=0
  1550. }
  1551. }
  1552. }
  1553.  
  1554. if(clk("paradoxend")){
  1555. Paradox=0
  1556. holoAlpha(2,0)
  1557. holoColor(2,vec(0,200,0))
  1558. chatPrint(Owner,"Paradox averted")
  1559. if(TARDIS:tardisPowered()==1){
  1560. TARDIS:tardisPower()
  1561. }
  1562. }
  1563.  
  1564. XYZ=getEscapePos()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement