From dd51875f8e81abb6575cd3caf5d339007c3e6f13 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sun, 15 Sep 2019 19:57:12 +0200 Subject: [PATCH] Teleport capsules added. With this, it's time to delve into uncharted territory for the remaining weapons. --- Readme.md | 2 +- modeldef.utranslocator | 143 +++++++++++++++++++++++ sndinfo.txt | 2 + zscript/peacemaker.zsc | 6 +- zscript/utranslocator.zsc | 231 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 382 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 14f4694..65d01b7 100644 --- a/Readme.md +++ b/Readme.md @@ -30,6 +30,7 @@ Doom Tournament (currently the devel branch is required). - Restored flashlight - Minigun (slot 0) (replaces chaingun) - SMP 7243 (slot 0) (replaces bfg9000) + - Teleport Capsules (slot 1) - Protomag (slot 2) (replaces pistol) - Dual Protomags - Quadshot (slot 3) (replaces shotguns) @@ -67,7 +68,6 @@ Doom Tournament (currently the devel branch is required). ## In progress - Razorclaw (slot 1) (replaces chainsaw) - - Teleport Capsules (slot 1) - Stunner (slot 4) (replaces chainsaw) - Fireblaster (slot 5) (replaces rocket launcher) - Flamethrower (slot 6) (replaces plasma rifle) diff --git a/modeldef.utranslocator b/modeldef.utranslocator index e192af6..e608893 100644 --- a/modeldef.utranslocator +++ b/modeldef.utranslocator @@ -1,3 +1,15 @@ +Model "UTranslocatorModule" +{ + Path "models" + Model 0 "TeleportProj_d.3d" + Skin 0 "Ahand1.png" + Scale 0.03 0.03 0.036 + AngleOffset 180 + ZOffset 3 + + FrameIndex TMOD A 0 0 +} + Model "UTranslocator" { Path "models" @@ -13,3 +25,134 @@ Model "UTranslocator" ROTATING FrameIndex TLCP A 1 0 } + +Model "UTranslocator" +{ + Path "models" + Model 0 "TeleHand_d.3d" + SurfaceSkin 0 0 "Ahand1.png" + SurfaceSkin 0 1 "Automa1.png" + AngleOffset 180 + Scale 0.1 -0.1 0.1 + Offset -12 -20 -12 + + // Down + FrameIndex TLCD A 0 1 + FrameIndex TLCD B 0 2 + FrameIndex TLCD C 0 3 + FrameIndex TLCD D 0 4 + FrameIndex TLCD E 0 5 + FrameIndex TLCD F 0 6 + // Select + FrameIndex TLCS A 0 6 + FrameIndex TLCS B 0 7 + FrameIndex TLCS C 0 8 + FrameIndex TLCS D 0 9 + FrameIndex TLCS E 0 10 + FrameIndex TLCS F 0 11 + FrameIndex TLCS G 0 12 + FrameIndex TLCS H 0 13 + // Idle + FrameIndex TLCI A 0 14 + FrameIndex TLCI B 0 15 + FrameIndex TLCI C 0 16 + FrameIndex TLCI D 0 17 + FrameIndex TLCI E 0 18 + FrameIndex TLCI F 0 19 + FrameIndex TLCI G 0 20 + // Twiddle + FrameIndex TLCT A 0 21 + FrameIndex TLCT B 0 22 + FrameIndex TLCT C 0 23 + FrameIndex TLCT D 0 24 + FrameIndex TLCT E 0 25 + FrameIndex TLCT F 0 26 + FrameIndex TLCT G 0 27 + FrameIndex TLCT H 0 28 + FrameIndex TLCT I 0 29 + // Fire + FrameIndex TLCF A 0 30 + FrameIndex TLCF B 0 31 + FrameIndex TLCF C 0 32 + FrameIndex TLCF D 0 33 + FrameIndex TLCF E 0 34 + FrameIndex TLCF F 0 35 + FrameIndex TLCF G 0 36 // throw + FrameIndex TLCF H 0 37 + FrameIndex TLCF I 0 38 + FrameIndex TLCF J 0 39 + FrameIndex TLCF K 0 40 + FrameIndex TLCF L 0 41 + FrameIndex TLCF M 0 42 + FrameIndex TLCF N 0 43 + FrameIndex TLCF O 0 44 + FrameIndex TLCF P 0 45 + FrameIndex TLCF Q 0 46 + FrameIndex TLCF R 0 47 + FrameIndex TLCF S 0 48 // pull up + FrameIndex TLCF T 0 49 + FrameIndex TLCF U 0 50 + FrameIndex TLCF V 0 51 + FrameIndex TLCF W 0 52 + FrameIndex TLCF X 0 53 + FrameIndex TLCF Y 0 54 + // Teleport + FrameIndex TLCA A 0 56 + FrameIndex TLCA B 0 57 + FrameIndex TLCA C 0 58 + FrameIndex TLCA D 0 59 + FrameIndex TLCA E 0 60 + FrameIndex TLCA F 0 61 // activate + FrameIndex TLCA G 0 62 + FrameIndex TLCA H 0 63 + FrameIndex TLCA I 0 64 + FrameIndex TLCA J 0 65 + FrameIndex TLCA K 0 66 + FrameIndex TLCA L 0 67 + // Recall + FrameIndex TLCR A 0 69 + FrameIndex TLCR B 0 70 + FrameIndex TLCR C 0 71 + FrameIndex TLCR D 0 72 + FrameIndex TLCR E 0 73 + FrameIndex TLCR F 0 74 + FrameIndex TLCR G 0 75 // activate + FrameIndex TLCR H 0 76 + FrameIndex TLCR I 0 77 + FrameIndex TLCR J 0 78 + FrameIndex TLCR K 0 79 + FrameIndex TLCR L 0 80 + FrameIndex TLCR M 0 81 + // The Birdâ„¢ + FrameIndex TLCB A 0 83 + FrameIndex TLCB B 0 84 + FrameIndex TLCB C 0 85 + FrameIndex TLCB D 0 86 + FrameIndex TLCB E 0 87 + FrameIndex TLCB F 0 88 + FrameIndex TLCB G 0 89 + FrameIndex TLCB H 0 90 + FrameIndex TLCB I 0 91 + FrameIndex TLCB J 0 92 + FrameIndex TLCB K 0 93 + FrameIndex TLCB L 0 94 + FrameIndex TLCB M 0 95 + FrameIndex TLCB N 0 96 + FrameIndex TLCB O 0 97 + FrameIndex TLCB P 0 98 + FrameIndex TLCB Q 0 99 + FrameIndex TLCB R 0 100 + FrameIndex TLCB S 0 101 + FrameIndex TLCB T 0 102 + FrameIndex TLCB U 0 103 + FrameIndex TLCB V 0 104 + FrameIndex TLCB W 0 105 + FrameIndex TLCB X 0 106 + FrameIndex TLCB Y 0 107 // pull up + FrameIndex TLCB Z 0 108 + FrameIndex TLCB [ 0 109 + FrameIndex TLCB \ 0 110 + FrameIndex TLCB ] 0 111 + FrameIndex TLB2 A 0 112 + FrameIndex TLB2 B 0 113 +} \ No newline at end of file diff --git a/sndinfo.txt b/sndinfo.txt index 23fc870..b8f5478 100644 --- a/sndinfo.txt +++ b/sndinfo.txt @@ -263,6 +263,8 @@ peace/throw peacethr peace/open peaceopn peace/fly brufly1 +telehand/throw peacethr + translator/event transa3 detector/start detact diff --git a/zscript/peacemaker.zsc b/zscript/peacemaker.zsc index 2e82892..b030bc2 100644 --- a/zscript/peacemaker.zsc +++ b/zscript/peacemaker.zsc @@ -409,7 +409,11 @@ Class Peacemaker : UnrealWeapon p.vel.z += 2.; p.target = self; if ( weap.Ammo1.Amount <= 0 ) player.SetPSprite(PSP_WEAPON,invoker.FindState("EmptyIdle")); - else player.SetPSprite(PSP_WEAPON,invoker.FindState("Ready")); + else + { + invoker.PlayUpSound(self); + player.SetPSprite(PSP_WEAPON,invoker.FindState("Ready")); + } } action void A_StartCount() { diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index 22844af..eac6d07 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -20,10 +20,115 @@ Class UTranslocatorAmmo : Ammo Class UTranslocatorModule : Actor { + Actor b; + bool alreadyhit; + double anglevel; + + Default + { + Radius 2; + Height 2; + Speed 16; + PROJECTILE; + -NOGRAVITY; + +USEBOUNCESTATE; + +SKYEXPLODE; + +HITTRACER; + +MOVEWITHSECTOR; + +CANBOUNCEWATER; + +BLOCKASPLAYER; + -ALLOWBOUNCEONACTORS; + +DONTBOUNCEONSHOOTABLES; + +INTERPOLATEANGLES; + BounceType "Hexen"; + BounceFactor 0.3; + WallBounceFactor 0.3; + Gravity 0.35; + } + + override void PostBeginPlay() + { + Super.PostBeginPlay(); + if ( !target ) + { + Destroy(); + return; + } + b = Spawn("ModuleHitbox",pos); + b.master = self; + anglevel = FRandom[TeleHand](3,5)*RandomPick[TeleHand](-1,1); + } + + override bool CanCollideWith( Actor other, bool passive ) + { + return (other != tracer); + } + + 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= tracer.pos.z+tracer.height) && tracer.bACTLIKEBRIDGE) ) alreadyhit = true; + } + } + Goto Spawn; + Death: + TMOD A -1 + { + if ( tracer && !tracer.bACTLIKEBRIDGE ) + { + SetOrigin(tracer.Vec2OffsetZ(0,0,pos.z),false); + vel.xy *= 0; + } + } + Stop; + } } Class UTranslocator : UnrealWeapon { + Actor module; + override bool TryPickup( in out Actor toucher ) { if ( !sting_telegun ) return false; // not allowed @@ -36,6 +141,85 @@ Class UTranslocator : UnrealWeapon if ( Owner ) Owner.RemoveInventory(self); Destroy(); } + override void DoEffect() + { + Super.DoEffect(); + if ( Ammo1 ) Ammo1.Amount = module?1:2; + } + action void A_ThrowModule() + { + Weapon weap = Weapon(invoker); + if ( !weap ) return; + A_PlaySound("telehand/throw",CHAN_WEAPON); + invoker.FireEffect(); + UTMainHandler.DoSwing(self,(FRandom[Translocator](0.2,-0.4),FRandom[Translocator](0.2,-0.7)),2,-0.3,3,SWING_Spring,2,3); + Vector3 x, y, z; + [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); + Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x-8.0*y-12.0*z; + let p = Spawn("UTranslocatorModule",origin); + p.target = self; + p.angle = angle; + p.pitch = BulletSlope(); + p.A_SetSize(radius); + Vector3 dir = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch)); + dir.z += 0.35*(1-abs(dir.z)); + p.vel = dir*p.speed; + invoker.module = p; + } + action void A_ReturnModule() + { + Weapon weap = Weapon(invoker); + if ( !weap ) return; + A_PlaySound("transloc/return",CHAN_WEAPON); + invoker.FireEffect(); + UTMainHandler.DoSwing(self,(FRandom[Translocator](-0.2,-0.4),FRandom[Translocator](-0.2,0.7)),3,-1,2,SWING_Spring,2,2); + if ( invoker.module && invoker.module.bAMBUSH ) + { + UTMainHandler.DoFlash(self,Color(255,255,255,255),50); + A_PlaySound("transloc/spark",CHAN_WEAPON); + DamageMobj(invoker,self,int.max,'Telefrag',DMG_THRUSTLESS); + } + if ( invoker.module ) invoker.module.Destroy(); + } + action void A_Translocate() + { + Weapon weap = Weapon(invoker); + if ( !weap ) return; + if ( !invoker.module ) + { + invoker.FireEffect(); + A_PlaySound("transloc/return",CHAN_WEAPON); + return; + } + // check if there's enough space + Vector3 oldpos = pos, newpos = invoker.module.pos; + double modulefloorz = invoker.module.floorz, moduleceilingz = invoker.module.ceilingz; + bool bBroken = invoker.module.bAMBUSH; + invoker.module.Destroy(); + invoker.FireEffect(); + // squeeze down new z if ceiling is in the way + if ( (newpos.z+height > moduleceilingz) ) newpos.z = max(modulefloorz,moduleceilingz-height); + if ( Warp(self,newpos.x,newpos.y,newpos.z,flags:WARPF_ABSOLUTEPOSITION|WARPF_TESTONLY) && TeleportMove(newpos,true) ) + { + A_PlaySound("flak/click",CHAN_WEAPON); + SpawnTeleportFog(oldpos,true,false); + SpawnTeleportFog(newpos,false,false); + player.fov = min(175,player.desiredfov+60); + } + else A_PlaySound("transloc/return",CHAN_WEAPON); + if ( bBroken ) + { + UTMainHandler.DoFlash(self,Color(255,255,255,255),50); + A_PlaySound("transloc/spark",CHAN_WEAPON); + DamageMobj(invoker,self,int.max,'Telefrag',DMG_THRUSTLESS); + } + } + override void OnDestroy() + { + Super.OnDestroy(); + if ( module ) module.Destroy(); + } + Default { Tag "$T_TELEGUN"; @@ -50,6 +234,8 @@ Class UTranslocator : UnrealWeapon UTWeapon.DropAmmo 2; +WEAPON.NO_AUTO_SWITCH; +WEAPON.CHEATNOTWEAPON; + +INVENTORY.UNDROPPABLE; + +INVENTORY.UNTOSSABLE; } States { @@ -58,5 +244,50 @@ Class UTranslocator : UnrealWeapon Stop; TLCP B -1; Stop; + Select: + TLCS A 1 A_Raise(int.max); + Wait; + Ready: + TLCS ABCDEFGH 2 A_WeaponReady(WRF_NOFIRE); + Goto Idle; + Dummy: + TNT1 A 1 A_WeaponReady(WRF_ALLOWRELOAD); + Wait; + Idle: + TLCI A 0 A_Overlay(-9999,"Dummy"); + TLCI ABCDEFG 20 A_Jump(16,"Twiddle"); + Goto Idle+1; + Twiddle: + #### # 6 { invoker.special1 = Random[TeleHand](2,5); } + TLCT ABCDEFGHI 3 A_SetTics(invoker.special1); + Goto Idle+1; + Fire: + TLCF A 0 A_Overlay(-9999,"Null"); + TLCF A 0 A_JumpIf(invoker.module,"Recall"); + TLCF ABCDEF 2; + TLCF G 0 A_ThrowModule(); + TLCF GHIJKLMNOPQRSTUVWXY 2; + Goto Idle; + Recall: + TLCR ABCDEF 2; + TLCR G 0 A_ReturnModule(); + TLCR GHIJKLM 2; + Goto Idle; + AltFire: + TLCA A 0 A_Overlay(-9999,"Null"); + TLCA A 0 A_JumpIf(!invoker.module,"Reload"); + TLCA ABCDE 2; + TLCA A 0 A_Translocate(); + TLCA FGHIJKL 2; + Goto Idle; + Reload: + TLCB A 0 A_Overlay(-9999,"Null"); + TLCB ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 2; + TLB2 AB 2; + Goto Idle; + Deselect: + TLCD A 0 A_Overlay(-9999,"Null"); + TLCD ABCDEF 1; + TLCD F 1 A_Lower(int.max); } }