#include "zcommon.acs" #library "DIABLOSC" Global int 50:TorchLife; Global int 51:tlpmap; Global bool 52:tlpact; Global int 53:CoordX; Global int 54:CoordY; Global int 55:CoordZ; Global bool 56:tlpstay; Global bool 57:amplon; Global int 58:daytime; Global bool 59:healon; script 650 (void) { delay(1); int a, b, c; TorchLife=1; a=getactorx(256); b=getactory(256); c=getactorz(256); Thing_ChangeTID(0, 340); if (amplon==true) { Thing_remove(340); TorchLife=0; Terminate; } setactorposition(340, a, b, 80.0+c, 0); } script 651 (void) { delay(1); TorchLife=0; } script 652 Enter { delay(1); if(Torchlife==1) { Spawn("DynamicTorch", getactorx(256), getactory(256), getactorz(256)+80.0, 340); } } script 653 Return { delay(1); if(Torchlife==1) { Spawn("DynamicTorch", getactorx(256), getactory(256), getactorz(256)+80.0, 340); } } script 610 (void) { delay(1); if(GetLevelInfo(LEVELINFO_LEVELNUM)==1) { terminate; } else if(tlpmap!=0) { ACS_Execute(10, tlpmap); tlpmap=0; delay(10); } CoordX = GetActorX(256) + FixedMul(cos(GetActorAngle(256)), 6553600); CoordY = GetActorY(256) + FixedMul(sin(GetActorAngle(256)), 6553600); CoordZ = GetActorZ(256); Spawn("TownPortal", CoordX, CoordY, CoordZ, 350); tlpmap=GetLevelInfo(LEVELINFO_LEVELNUM); } script 611 (void) { int x1, y1, z1, len; while (TRUE) { y1 = getactory(256) - getactory(350); x1 = getactorx(256) - getactorx(350); z1 = getactorz(256) - getactorz(350); int ang = vectorangle(x1,y1); if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(y1, sin(ang)); else len = fixeddiv(x1, cos(ang)); ang = vectorangle(len, z1); if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(z1, sin(ang)); else len = fixeddiv(len, cos(ang)); if (len<20.0) { if (GetLevelInfo(LEVELINFO_LEVELNUM)==1) { tlpact=true; tlpstay=false; teleport_newmap(tlpmap,0); } else { tlpact=true; teleport_newmap(1,3); } } delay(1); } } script 612 return { if(GetLevelInfo(LEVELINFO_LEVELNUM)!=1 && tlpact==true) { thing_destroy(350); thing_remove(350); ACS_Execute(10, 1); SetActorPosition(256, CoordX, CoordY, CoordZ, 0); tlpact=false; tlpmap=0; ActivatorSound("tlpenter", 127); } } script 613 enter { if (GetLevelInfo(LEVELINFO_LEVELNUM)==1 && tlpmap!=0 && tlpstay==false) { Spawn("TownPortal", -412.0, 176.0, -8.0, 350); tlpstay=true; } if(GetLevelInfo(LEVELINFO_LEVELNUM)==1 && tlpact==true) { ActivatorSound("tlpenter", 127); tlpact=false; } } script 614 return { int a, b, c; if (GetLevelInfo(LEVELINFO_LEVELNUM)==1 && tlpmap!=0 && tlpstay==false) { a=getactorx(256); b=getactory(256); c=getactorz(256); Spawn("TownPortal", -412.0, 176.0, -8.0, 350); tlpstay=true; } if(GetLevelInfo(LEVELINFO_LEVELNUM)==1 && tlpact==true) { ActivatorSound("tlpenter", 127); tlpact=false; } } Script 620 (void) { delay(1); Thing_ChangeTID(0, 360); int x1, y1, z1, len; y1 = getactory(256) - getactory(360); x1 = getactorx(256) - getactorx(360); z1 = getactorz(256) - getactorz(360); int ang = vectorangle(x1,y1); if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(y1, sin(ang)); else len = fixeddiv(x1, cos(ang)); ang = vectorangle(len, z1); if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(z1, sin(ang)); else len = fixeddiv(len, cos(ang)); if (len<50.0 && amplon==false) { if(TorchLife==1) { thing_remove(340); TorchLife=0; } Spawn("AmplifyDMG", getactorx(256), getactory(256), getactorz(256)+80.0, 361); amplon=true; SetActorProperty(256, APROP_DamageFactor, 2.0); } } Script 621 (void) { int sid = 1; int a, b, c, d; d=361; while ( sid < 1000 ) { a=getactorx(256); b=getactory(256); c=getactorz(256); setactorposition(d, a, b, 70.0+c, 0); delay (1); sid++ ; } amplon=false; SetActorProperty(256, APROP_DamageFactor, 1.0); thing_remove(d); } Script 630 unloading { amplon=false; ACS_Terminate(20,0); ACS_Terminate(21,0); ACS_Terminate(22,0); ACS_Terminate(23,0); SetActorProperty(256, APROP_DamageFactor, 1.0); thing_remove(361); thing_remove(340); } Script 635 (void) { ActivatorSound("gold", 127); } Script 640 enter { switch(daytime) { case 0: delay(1); daytime=1; ACS_Execute(20,0); break; case 1: delay(1); daytime=2; ACS_Execute(21,0); break; case 2: delay(1); daytime=3; ACS_Execute(22,0); break; case 3: delay(1); daytime=0; ACS_Execute(23,0); break; } } Script 641 return { switch(daytime) { case 0: delay(1); daytime=1; ACS_Execute(20,0); break; case 1: delay(1); daytime=2; ACS_Execute(21,0); break; case 2: delay(1); daytime=3; ACS_Execute(22,0); break; case 3: delay(1); daytime=0; ACS_Execute(23,0); break; } } Script 642 (void) { switch(daytime) { case 0: delay(1); daytime=1; //ACS_Execute(20,0); break; case 1: delay(1); daytime=2; //ACS_Execute(21,0); break; case 2: delay(1); daytime=3; //ACS_Execute(22,0); break; case 3: delay(1); daytime=0; //ACS_Execute(23,0); break; } } Script 645 (void) { if(daytime==1) { SetActorState(10,"Greet_day"); } if(daytime==2 || daytime==3) { SetActorState(10,"Greet_eve"); } if(daytime==0) { SetActorState(10,"Greet_mor"); } } script 660 (void) { if(healon == FALSE) { healon = TRUE; int i=1; while (i<50) { HealThing(1); delay(5); i=i+1; } healon = FALSE; } else terminate; }