slot4-throw.zsc (2528B)
1 class ThrowTech : DevilbunnyWeapon 2 { 3 Default 4 { 5 Weapon.SlotNumber 5; 6 +WEAPON.NOALERT 7 +DONTGIB 8 DevilbunnyWeapon.CanParry FALSE; 9 } 10 11 States 12 { 13 Ready: 14 THSW C 1 15 { 16 A_WeaponReady(); 17 } 18 loop; 19 Deselect: 20 TNT1 A 1 A_Lower(500); 21 loop; 22 Select: 23 THSW A 6 Offset(0, 32); 24 THSW B 2 Offset(0, 32); 25 TNT1 A 1 A_Raise(500); 26 Goto Ready; 27 Fire: 28 THSW E 2; 29 THSW D 12 30 { 31 let tsword = SpawnPlayerMissile("ThrownSword", Angle); 32 A_StartSound("grief/toss", CHAN_WEAPON, CHANF_DEFAULT); 33 } 34 TNT1 A 0 35 { 36 //force switch to fist 37 let tfist = Weapon(FindInventory("CorpsACorps")); 38 if (tfist != NULL) 39 { 40 self.player.PendingWeapon = tfist; 41 } 42 } 43 Goto Ready; 44 } 45 } 46 47 class ThrownSword : Actor 48 { 49 Default 50 { 51 Radius 11; 52 Height 8; 53 Speed 25; 54 ProjectileKickBack 15; 55 DamageFunction (random(4000, 8000)); 56 Species "Player"; 57 Projectile; 58 +THRUSPECIES 59 // +ROLLSPRITE 60 // +FORCEXYBILLBOARD 61 +SKYEXPLODE //don't want your sword vanishing as soon as it touches the skybox! 62 -NOGRAVITY 63 Gravity 0.3; 64 } 65 66 States 67 { 68 Spawn: 69 TNT1 A 0 Nodelay 70 { 71 if(!target) 72 SetStateLabel("Crash"); 73 74 let owner1 = DevilbunnyPlayer(target); 75 owner1.thrownSword = self; 76 Vel += owner1.Vel; 77 owner1.hasSword = 0; 78 if (owner1.Pitch < -55 ) 79 { 80 SetStateLabel("Fly2"); 81 } 82 } 83 Fly: 84 THRO A 2; 85 TNT1 A 0 Spawn("ZippySpark", pos); 86 loop; 87 Fly2: 88 SORD B 1; 89 loop; 90 Death: 91 Crash: 92 TNT1 A 0 93 { 94 bForceXYBillboard = true; 95 if (pos.z > floorz) 96 { 97 A_ChangeVelocity(-15, 0, 0, CVF_RELATIVE | CVF_REPLACE); 98 } 99 else 100 { 101 vel.z = 5; 102 103 } 104 105 } 106 XDeath: //when hitting a bleeding actor 107 THRO A 1 108 { 109 A_Explode(250, 32, 0, TRUE, 16); //this is so you can kill the icon of sin with a well-placed sword throw! 110 A_StartSound("throspin", CHAN_6); 111 A_StartSound("ting", CHAN_WEAPON, CHANF_DEFAULT, 1.0, ATTN_IDLE, 1.0); 112 } 113 Spin: 114 SPON ABCD 2 A_Explode(40, 64, 0, FALSE, 64); 115 TNT1 A 0 116 { 117 if (pos.z <= floorz) 118 { 119 SetStateLabel("Land"); 120 } 121 } 122 loop; 123 Land: 124 SPON D 4 125 { 126 let owner1 = DevilbunnyPlayer(target); 127 owner1.thrownSword = spawn("SwordPickup", pos, NO_REPLACE); 128 A_StartSound("swordland", CHAN_WEAPON, CHANF_DEFAULT, 0.6, ATTN_IDLE, 1.0); 129 A_StopSound(CHAN_6); 130 } 131 stop; 132 Poof: 133 TNT1 A 1; 134 stop; 135 } 136 137 }