etayn

old gzdoom project
git clone git://moonbender.net/etayn
Log | Files | Refs | README

slot2-pflug.zsc (2628B)


      1 class Pflug : DevilbunnyWeapon
      2 {
      3 	const VOMMINDAMAGE = 100;
      4 	const VOMMAXDAMAGE = 250;
      5 
      6 	Default
      7 	{
      8 		Weapon.SlotNumber 2;
      9 		Weapon.Kickback 200;
     10 		+WEAPON.NOALERT
     11 		DevilbunnyWeapon.CanParry TRUE;
     12 	}
     13 	
     14 	action void createSlashEffects()
     15 	{
     16 		if (random(1, 100) < 4) //only create a dust devil about 5% of swings
     17 		{
     18 			spawn("DustDevil", self.pos, NO_REPLACE);
     19 		}
     20 		A_FireProjectile("StrikeBlast", 0, 0, 0, 0, 0, 0);
     21 	}
     22 	
     23 
     24 	
     25 	//From what I can tell, zdoom has no non-hacky way of doing away with doom's specific weapon raising and lowering mechanics. Oh well
     26 	States
     27 	{
     28 		Ready:
     29 			PHSD A 1
     30 			{
     31 				A_WeaponReady();
     32 				invoker.parryAnimReady = TRUE;
     33 			}
     34 			Loop;
     35 		Deselect:
     36 			TNT1 A 0 A_Lower(999);
     37 			loop;
     38 		Select:
     39 			DRAW AB 2 Offset(0, 32);
     40 			DRAW C 5 Offset(0, 32);
     41 			DRAW D 3 Offset(0, 32);
     42 			PHSD A 0 A_Raise(999);
     43 			loop;
     44 		Parry:
     45 			TNT1 A 0
     46 			{
     47 				A_StartSound("tink", CHAN_WEAPON, CHANF_DEFAULT, 0.5, ATTN_NORM, 1);
     48 				invoker.parryAnimReady = FALSE;
     49 			}
     50 			TNT1 A 0 A_Jump(127, "ParryA");
     51 			PARY AABBCCCCC 1 A_WeaponReady();
     52 			goto Ready;
     53 		ParryA:
     54 			PARY DDEEFFFFF 1 A_WeaponReady();
     55 			goto Ready;
     56 		Fire:
     57 			TNT1 A 0
     58 			{
     59 				invoker.parryAnimReady = FALSE;
     60 			}
     61 			TNT1 A 0 A_Jump(127, "SwingRight");
     62 		SwingLeft:
     63 			PHSD B 8;
     64 			PHSD C 1;
     65 			PHSD D 1
     66 			{
     67 				HorizFan(150, -100, VOMMINDAMAGE, VOMMAXDAMAGE, 256, "VomSlashLeft", "ClangEffectSmall");
     68 				createSlashEffects();
     69 			}
     70 			PHSD E 4;
     71 			TNT1 A 7;
     72 			TNT1 A 0 A_ReFire;
     73 			Goto Ready;
     74 		SwingRight:
     75 			PHSD F 8;
     76 			PHSD G 1;
     77 			PHSD H 1
     78 			{
     79 				HorizFan(-150, 100, VOMMINDAMAGE, VOMMAXDAMAGE, 256, "VomSlashRight", "ClangEffectSmall");
     80 				createSlashEffects();
     81 			}
     82 			PHSD I 4;
     83 			TNT1 A 7;
     84 			TNT1 A 0 A_ReFire;
     85 			Goto Ready;
     86 	}
     87 }
     88 
     89 class VomSlashLeft : SlashEffectBase
     90 {
     91 	states
     92 	{
     93 		XDeath:
     94 			TNT1 A 1
     95 			{
     96 				GrantImmune();
     97 				Actor sblood;
     98 				sblood = spawn("SHorizBlood", pos, NO_REPLACE);
     99 				sblood.Thrust(10, angle - 90 + random(-10, 10));
    100 				sblood.Vel.z += random(-1, 5);
    101 			}
    102 			Stop;
    103 	}
    104 }
    105 
    106 class ClangEffectSmall : BulletPuff
    107 {
    108 	default
    109 	{
    110 		-ALLOWPARTICLES
    111 		AttackSound "grief/clang";
    112 		+ALLOWTHRUFLAGS
    113 		+THRUACTORS
    114 		+NOEXTREMEDEATH
    115 	}
    116 
    117 	states
    118 	{
    119 		Spawn:
    120 		Crash:
    121 			TNT1 A 1;
    122 			stop;
    123 	}
    124 }
    125 
    126 class VomSlashRight : SlashEffectBase
    127 {
    128 	states
    129 	{
    130 		XDeath:
    131 			TNT1 A 1
    132 			{
    133 				GrantImmune();
    134 				Actor sblood;
    135 				sblood = spawn("SHorizBlood", pos, NO_REPLACE);
    136 				sblood.Thrust(10, angle + 90 + random(-10, 10));
    137 				sblood.Vel.z += random(-1, 5);
    138 			}
    139 			Stop;
    140 	}
    141 }