etayn

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

slot3-fleche.zsc (2645B)


      1 class Fleche : DevilbunnyWeapon
      2 {
      3 	int dashCharge;
      4 
      5 	Default
      6 	{
      7 		Weapon.SlotNumber 3;
      8 		Weapon.Kickback 0;
      9 //		+WEAPON.NOALERT
     10 		+FORCERADIUSDMG
     11 		DevilbunnyWeapon.CanParry TRUE;
     12 
     13 	}
     14 	
     15 	action void incCharge()
     16 	{
     17 		if (invoker.dashCharge < 70)
     18 		{
     19 			invoker.dashCharge = invoker.dashCharge + 1;
     20 		}
     21 	}
     22 	
     23 	action int checkCharge()
     24 	{
     25 		return invoker.dashCharge;
     26 	}
     27 	
     28 	action void clearCharge()
     29 	{
     30 		invoker.dashCharge = 0;
     31 	}
     32 	
     33 	States
     34 	{
     35 		Ready:
     36 			BLSD A 1
     37 			{	
     38 				clearCharge();
     39 				A_WeaponReady();
     40 			}
     41 			Loop;
     42 		Deselect:
     43 			BLSD B 8 A_Lower(500);
     44 			Loop;
     45 		Select:
     46 			BLSD DE 3 Offset(0, 32);
     47 			TNT1 A 0 A_Raise(500);
     48 			Loop;
     49 		Fire:
     50 			TNT1 A 0 A_StartSound("ting");
     51 		Charge:
     52 			TNT1 A 0
     53 			{	
     54 				A_ReFire();
     55 			}
     56 			TNT1 A 1
     57 			{
     58 				let DBowner = DevilbunnyPlayer(self);
     59 				DBowner.PlayDash();
     60 				if (checkCharge() >= 50)
     61 				{
     62 					return ResolveState("DashBig");
     63 				}
     64 				if (checkCharge() >= 20)
     65 				{
     66 					return ResolveState("DashMid");
     67 				}
     68 				return ResolveState("DashSmall");
     69 			}
     70 		Hold:
     71 			TNT1 A 0
     72 			{
     73 				incCharge();
     74 				int x = checkCharge();
     75 			}
     76 			BLSD B 1;
     77 			Goto Charge;
     78 		DashBig:
     79 			BLSD C 4
     80 			{
     81 				A_ChangeVelocity(110, 0, 0, CVF_RELATIVE);
     82 				bTHRUACTORS = true;
     83 			}
     84 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
     85 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
     86 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
     87 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
     88 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
     89 			BLSD C 5
     90 			{
     91 				bTHRUACTORS = false;
     92 			}
     93 			BLSD A 5;
     94 			Goto Ready;
     95 		DashMid:
     96 			BLSD C 4
     97 			{
     98 				A_ChangeVelocity(80, 0, 0, CVF_RELATIVE);
     99 				bTHRUACTORS = true;
    100 			}
    101 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    102 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    103 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    104 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    105 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    106 			BLSD C 5
    107 			{
    108 				bTHRUACTORS = false;
    109 			}
    110 			BLSD A 5;
    111 			Goto Ready;
    112 		DashSmall:
    113 			BLSD C 4
    114 			{
    115 				A_ChangeVelocity(45, 0, 0, CVF_RELATIVE);
    116 				bTHRUACTORS = true;
    117 			}
    118 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    119 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    120 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    121 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    122 			BLSD C 2 A_Explode(random(20,30), 128, 0, TRUE, 128);
    123 			BLSD C 5
    124 			{
    125 				bTHRUACTORS = false;
    126 			}
    127 			BLSD A 5;
    128 			Goto Ready;
    129 	}
    130 }