diff --git a/modeldef.transloc b/modeldef.transloc index 87ea8b8..8f7f071 100644 --- a/modeldef.transloc +++ b/modeldef.transloc @@ -1,3 +1,18 @@ +Model "TranslocatorModule" +{ + Path "models" + Model 0 "Module_d.3d" + Skin 0 "tloc2_.png" + Scale -0.0672 0.056 0.056 + PitchOffset 90 + ZOffset 6 + USEACTORPITCH + + FrameIndex TMOD A 0 0 + FrameIndex TMOD B 0 1 + FrameIndex TMOD C 0 2 +} + Model "Translocator" { Path "models" @@ -25,3 +40,107 @@ Model "Translocator" FrameIndex TLCP B 1 0 } + +Model "Translocator" +{ + Path "models" + Model 0 "Transloc_d.3d" + SurfaceSkin 0 0 "tloc1.png" + SurfaceSkin 0 1 "tloc2.png" + SurfaceSkin 0 2 "tloc3.png" + SurfaceSkin 0 3 "tloc4.png" + Scale 0.11 0.055 0.11 + Offset -17.8 -22.8 -33.2 + PitchOffset 87 + RollOffset 5 + AngleOffset 183 + + // select + FrameIndex TLCS A 0 18 + FrameIndex TLCS B 0 19 + FrameIndex TLCS C 0 20 + FrameIndex TLCS D 0 21 + FrameIndex TLCS E 0 22 + FrameIndex TLCS F 0 23 + FrameIndex TLCS G 0 24 + FrameIndex TLCS H 0 25 + FrameIndex TLCS I 0 26 + FrameIndex TLCS J 0 27 + FrameIndex TLCS K 0 28 + FrameIndex TLCS L 0 29 + // throw + FrameIndex TLCF A 0 32 + FrameIndex TLCF B 0 33 + FrameIndex TLCF C 0 34 + FrameIndex TLCF D 0 35 + FrameIndex TLCF E 0 36 + FrameIndex TLCF F 0 37 + FrameIndex TLCF G 0 38 + FrameIndex TLCF H 0 39 + FrameIndex TLCF I 0 40 + FrameIndex TLCF J 0 41 + FrameIndex TLCF K 0 42 + FrameIndex TLCF L 0 43 + FrameIndex TLCF M 0 44 + FrameIndex TLCF N 0 45 + // pre reset + FrameIndex TLCF O 0 46 + FrameIndex TLCF P 0 47 + FrameIndex TLCF Q 0 48 + FrameIndex TLCF R 0 49 + FrameIndex TLCF S 0 50 + // idle + FrameIndex TLCI A 0 51 + FrameIndex TLCI B 0 52 + // down + FrameIndex TLCD A 0 66 + FrameIndex TLCD B 0 67 + FrameIndex TLCD C 0 68 + FrameIndex TLCD D 0 69 + FrameIndex TLCD E 0 70 + FrameIndex TLCD F 0 71 + FrameIndex TLCD G 0 72 + // thrown frame + FrameIndex TLCT A 0 52 + // thrown + FrameIndex TLCT B 0 53 + FrameIndex TLCT C 0 54 + FrameIndex TLCT D 0 55 + FrameIndex TLCT E 0 56 + FrameIndex TLCT F 0 57 + FrameIndex TLCT G 0 58 + FrameIndex TLCT H 0 59 + FrameIndex TLCT I 0 60 + FrameIndex TLCT J 0 61 + FrameIndex TLCT K 0 62 + FrameIndex TLCT L 0 63 + FrameIndex TLCT M 0 64 + // down 2 + FrameIndex TLD2 A 0 77 + FrameIndex TLD2 B 0 78 + FrameIndex TLD2 C 0 79 + FrameIndex TLD2 D 0 80 + FrameIndex TLD2 E 0 81 + FrameIndex TLD2 F 0 82 + FrameIndex TLD2 G 0 83 + // idle 2 + FrameIndex TLI2 A 0 88 + FrameIndex TLI2 B 0 89 + FrameIndex TLI2 C 0 90 + FrameIndex TLI2 D 0 91 + FrameIndex TLI2 E 0 92 + FrameIndex TLI2 F 0 93 + FrameIndex TLI2 G 0 94 + FrameIndex TLI2 H 0 95 + FrameIndex TLI2 I 0 96 + FrameIndex TLI2 J 0 97 + FrameIndex TLI2 K 0 98 + FrameIndex TLI2 L 0 99 + FrameIndex TLI2 M 0 100 + FrameIndex TLI2 N 0 101 + FrameIndex TLI2 O 0 102 + FrameIndex TLI2 P 0 103 + FrameIndex TLI2 Q 0 104 + FrameIndex TLI2 R 0 105 + FrameIndex TLI2 S 0 106 +} diff --git a/readme.txt b/readme.txt index 24d55ff..cb2f981 100644 --- a/readme.txt +++ b/readme.txt @@ -32,10 +32,10 @@ Currently implemented: - UT HUD - Impact Hammer (slot 1) - Chainsaw (slot 1) + - Translocator (slot 1) In progress: - - Translocator (slot 1) - Enforcer (slot 2) - Dual Enforcers (slot 2) - Ripper (slot 6) diff --git a/sndinfo.txt b/sndinfo.txt index 12337f1..5bbcb66 100644 --- a/sndinfo.txt +++ b/sndinfo.txt @@ -133,6 +133,12 @@ chainsaw/idle chainidl chainsaw/lower chainpdn chainsaw/fire sawhit +transloc/throw throwtgt +transloc/return rtarget +transloc/spark tdisrupt +transloc/bounce hit1 +transloc/hum targeth + ges/hit gelhit ges/select gelselec ges/fire gelshot diff --git a/sounds/RTarget.wav b/sounds/RTarget.wav new file mode 100644 index 0000000..4c27714 Binary files /dev/null and b/sounds/RTarget.wav differ diff --git a/sprites/TGLOA0.png b/sprites/TGLOA0.png new file mode 100644 index 0000000..fdbcc3f Binary files /dev/null and b/sprites/TGLOA0.png differ diff --git a/textures.transloc b/textures.transloc index 80eb218..cbc2d62 100644 --- a/textures.transloc +++ b/textures.transloc @@ -1,2 +1,84 @@ Sprite "TLCPA0",1,1{} Sprite "TLCPB0",1,1{} +Sprite "TLCSA0",1,1{} +Sprite "TLCSB0",1,1{} +Sprite "TLCSC0",1,1{} +Sprite "TLCSD0",1,1{} +Sprite "TLCSE0",1,1{} +Sprite "TLCSF0",1,1{} +Sprite "TLCSG0",1,1{} +Sprite "TLCSH0",1,1{} +Sprite "TLCSI0",1,1{} +Sprite "TLCSJ0",1,1{} +Sprite "TLCSK0",1,1{} +Sprite "TLCSL0",1,1{} +Sprite "TLCFA0",1,1{} +Sprite "TLCFB0",1,1{} +Sprite "TLCFC0",1,1{} +Sprite "TLCFD0",1,1{} +Sprite "TLCFE0",1,1{} +Sprite "TLCFF0",1,1{} +Sprite "TLCFG0",1,1{} +Sprite "TLCFH0",1,1{} +Sprite "TLCFI0",1,1{} +Sprite "TLCFJ0",1,1{} +Sprite "TLCFK0",1,1{} +Sprite "TLCFL0",1,1{} +Sprite "TLCFM0",1,1{} +Sprite "TLCFN0",1,1{} +Sprite "TLCFO0",1,1{} +Sprite "TLCFP0",1,1{} +Sprite "TLCFQ0",1,1{} +Sprite "TLCFR0",1,1{} +Sprite "TLCFS0",1,1{} +Sprite "TLCIA0",1,1{} +Sprite "TLCIB0",1,1{} +Sprite "TLCDA0",1,1{} +Sprite "TLCDB0",1,1{} +Sprite "TLCDC0",1,1{} +Sprite "TLCDD0",1,1{} +Sprite "TLCDE0",1,1{} +Sprite "TLCDF0",1,1{} +Sprite "TLCDG0",1,1{} +Sprite "TLCTA0",1,1{} +Sprite "TLCTB0",1,1{} +Sprite "TLCTC0",1,1{} +Sprite "TLCTD0",1,1{} +Sprite "TLCTE0",1,1{} +Sprite "TLCTF0",1,1{} +Sprite "TLCTG0",1,1{} +Sprite "TLCTH0",1,1{} +Sprite "TLCTI0",1,1{} +Sprite "TLCTJ0",1,1{} +Sprite "TLCTK0",1,1{} +Sprite "TLCTL0",1,1{} +Sprite "TLCTM0",1,1{} +Sprite "TLD2A0",1,1{} +Sprite "TLD2B0",1,1{} +Sprite "TLD2C0",1,1{} +Sprite "TLD2D0",1,1{} +Sprite "TLD2E0",1,1{} +Sprite "TLD2F0",1,1{} +Sprite "TLD2G0",1,1{} +Sprite "TLI2A0",1,1{} +Sprite "TLI2B0",1,1{} +Sprite "TLI2C0",1,1{} +Sprite "TLI2D0",1,1{} +Sprite "TLI2E0",1,1{} +Sprite "TLI2F0",1,1{} +Sprite "TLI2G0",1,1{} +Sprite "TLI2H0",1,1{} +Sprite "TLI2I0",1,1{} +Sprite "TLI2J0",1,1{} +Sprite "TLI2K0",1,1{} +Sprite "TLI2L0",1,1{} +Sprite "TLI2M0",1,1{} +Sprite "TLI2N0",1,1{} +Sprite "TLI2O0",1,1{} +Sprite "TLI2P0",1,1{} +Sprite "TLI2Q0",1,1{} +Sprite "TLI2R0",1,1{} +Sprite "TLI2S0",1,1{} +Sprite "TMODA0",1,1{} +Sprite "TMODB0",1,1{} +Sprite "TMODC0",1,1{} diff --git a/zscript/translocator.zsc b/zscript/translocator.zsc index 96e7602..08b58b4 100644 --- a/zscript/translocator.zsc +++ b/zscript/translocator.zsc @@ -1,5 +1,353 @@ +Class ModuleHitbox : Actor +{ + Default + { + Radius 10; + Height 4; + +SHOOTABLE; + +NOGRAVITY; + +NOCLIP; + +DONTSPLASH; + +NOBLOOD; + } + override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle ) + { + if ( target ) + { + if ( inflictor ) target.vel += level.Vec3Diff(inflictor.pos,pos).unit()*damage*0.2; + else if ( source ) target.vel += level.Vec3Diff(source.pos,pos).unit()*damage*0.2; + target.vel.z = 5; + } + if ( !target || (target.target && ((target.target == source) || target.target.isTeammate(source))) ) return 0; + target.bAMBUSH = true; + return 0; + } + override void Tick() + { + Super.Tick(); + if ( !target ) + { + Destroy(); + return; + } + SetOrigin(target.pos-(0,0,height*0.5),true); + if ( target.bMISSILE ) return; + let bi = BlockThingsIterator.Create(self,32); + while ( bi.Next() ) + { + if ( !bi.Thing || (bi.Thing != target.target) ) continue; + if ( (Distance2D(bi.Thing)-bi.Thing.radius <= radius) && ((bi.Thing.pos.z <= pos.z+height) && (bi.Thing.pos.z+bi.Thing.height >= pos.z-height)) ) + { + A_PlaySound("misc/i_pkup"); + target.Destroy(); + return; + } + } + } + States + { + Spawn: + TNT1 A 10 A_AlertMonsters(0,AMF_TARGETEMITTER); + Wait; + } +} + +Class TranslocatorGlowLight : DynamicLight +{ + Default + { + DynamicLight.Type "Point"; + Args 255,255,255,40; + } + override void Tick() + { + Super.Tick(); + if ( !target ) + { + Destroy(); + return; + } + SetOrigin(target.pos,true); + } +} + +Class TranslocatorGlow : Actor +{ + override void PostBeginPlay() + { + Super.PostBeginPlay(); + let l = Spawn("TranslocatorGlowLight",pos); + l.target = self; + l.args[0] = fillcolor.r; + l.args[1] = fillcolor.g; + l.args[2] = fillcolor.b; + } + override void Tick() + { + Super.Tick(); + if ( !target ) + { + Destroy(); + return; + } + SetOrigin(target.Vec3Offset(0,0,10),true); + } + Default + { + Radius 0.1; + Height 0; + +NOCLIP; + +NOGRAVITY; + +DONTSPLASH; + +FORCEXYBILLBOARD; + RenderStyle "AddShaded"; + StencilColor "FFFFFF"; + Scale 0.5; + } + States + { + Spawn: + TGLO A -1 Bright; + Stop; + } +} + +Class TranslocatorModule : Actor +{ + Actor b; + + Default + { + Radius 2; + Height 2; + Speed 20; + PROJECTILE; + -NOGRAVITY; + +USEBOUNCESTATE; + +SKYEXPLODE; + +HITTRACER; + BounceType "Doom"; + BounceFactor 0.5; + WallBounceFactor 0.5; + } + + override void PostBeginPlay() + { + Super.PostBeginPlay(); + if ( !target ) + { + Destroy(); + return; + } + b = Spawn("ModuleHitbox",pos); + b.target = self; + A_PlaySound("transloc/hum",CHAN_VOICE,0.5,true,2.0); + } + + override bool CanCollideWith( Actor other, bool passive ) + { + return (other != tracer); + } + + action void A_LightUp() + { + let l = Spawn("TranslocatorGlow",Vec3Offset(0,0,10)); + l.target = self; + if ( !target || !target.player ) return; + Color gcol; + if ( deathmatch && (target.player.GetTeam() < teams.size()) ) gcol = teams[target.player.GetTeam()].mName; + else gcol = target.player.GetColor(); + // maximize brightness + if ( (gcol.r+gcol.g+gcol.b) <= 0 ) gcol = "White"; + else + { + int maxcomp = max(gcol.r,max(gcol.g,gcol.b)); + int newr = int(gcol.r*(255./maxcomp)); + int newg = int(gcol.g*(255./maxcomp)); + int newb = int(gcol.b*(255./maxcomp)); + gcol = Color(newr,newg,newb); + } + l.SetShade(gcol); + } + + override void Tick() + { + Super.Tick(); + if ( bAMBUSH && !Random[Transloc](0,40) ) + { + A_PlaySound("transloc/spark"); + int numpt = Random[Transloc](20,40); + for ( int i=0; i