etayn

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

powerups.zsc (5795B)


      1 class ParryAct : Actor
      2 {
      3 	bool justHit;
      4 	
      5 	Default
      6 	{
      7 		Species "Player";
      8 		Speed 0;
      9 		PainChance 255;
     10 		Radius 32;
     11 		Height 32;
     12 		Mass 0x7FFFFFFF;
     13 		PainChance "PlayerDamage", 0;
     14 		+NOTARGET
     15 		+NOINFIGHTING
     16 		-SOLID
     17 		+NOGRAVITY
     18 		+THRUSPECIES
     19 		+SHOOTABLE
     20 		+NOBLOOD
     21 		+DONTSPLASH
     22 		+DONTRIP
     23 		+NOCLIP
     24 		+NODAMAGE
     25 //		+REFLECTIVE
     26 //		+DEFLECT
     27 		+ALLOWTHRUFLAGS
     28 		+NOTELEPORT
     29 	}
     30 	
     31 /* alas! It almost works. Might be possible with EventHandlers
     32 	override int DamageMobj(Actor inflictor, Actor source, int damage, Name mod, int flags, double angle)
     33 	{
     34 		if (inflictor)
     35 		{
     36 			if(inflictor.GetClassName() == "Rocket")
     37 			{
     38 				Actor x, y;
     39 				x = Spawn("ChoppedRocket", inflictor.pos, NO_REPLACE);
     40 				y = Spawn("ChoppedRocket", inflictor.pos, NO_REPLACE);
     41 				x.thrust(20, inflictor.angle);
     42 				y.thrust(20, inflictor.angle);
     43 				inflictor.A_Remove(AAPTR_DEFAULT, RMVF_MISSILES);
     44 				flags = DMG_THRUSTLESS;
     45 			}
     46 		}
     47 		
     48 		return Super.DamageMobj(inflictor, source, damage, mod, flags, angle);
     49 	}
     50 */
     51 
     52 	States
     53 	{
     54 		Spawn:
     55 			TNT1 A 1
     56 			{
     57 				justHit = FALSE;
     58 			}
     59 			loop;
     60 		Pain:
     61 			TNT1 A 0
     62 			{
     63 				justHit = TRUE;
     64 			}
     65 			TNT1 A 6;
     66 			Goto Spawn;
     67 		Death:
     68 			Goto Spawn;
     69 	}
     70 }
     71 
     72 class DBPickupBase : CustomInventory
     73 {
     74 	Default
     75 	{
     76 		+COUNTITEM
     77 	}
     78 	//only call this in the Pickup state, otherwise it will do nothing
     79 	action void GiveSpirit(int amount)
     80 	{
     81 		let owner1 = DevilbunnyPlayer(self);
     82 		owner1.GainSpirit(amount);
     83 	}
     84 	
     85 	action void GiveHealth(int amount)
     86 	{
     87 		let owner1 = DevilbunnyPlayer(self);
     88 		owner1.GainHealth(amount);
     89 	}
     90 }
     91 
     92 class StunPickup : DBPickupBase replaces Chainsaw
     93 {
     94 	Default
     95 	{
     96 		Inventory.Pickupmessage "Your unarmed strikes become more forceful!";
     97 	}
     98 	
     99 	States
    100 	{
    101 		Spawn:
    102 			SAWP A -1;
    103 			stop;
    104 		Pickup:
    105 			TNT1 A 0
    106 			{
    107 				let owner1 = DevilbunnyPlayer(self);
    108 				owner1.stunPunch = 1;
    109 				A_SelectWeapon("CorpsACorps");
    110 				GiveSpirit(10);
    111 			}
    112 			stop;
    113 	}
    114 
    115 }
    116 
    117 class HandofGlory : DBPickupBase replaces Soulsphere
    118 {
    119 	default
    120 	{
    121 		Inventory.PickupMessage "Holy artifact!";
    122 	}
    123 	
    124 	states
    125 	{
    126 		Spawn:
    127 			HOGL A -1;
    128 			stop;
    129 		Pickup:
    130 			TNT1 A 0
    131 			{
    132 				GiveHealth(50);
    133 				GiveSpirit(50);
    134 			}
    135 	}
    136 	
    137 }
    138 
    139 class Reliquary : DBPickupBase replaces Megasphere
    140 {
    141 	default
    142 	{
    143 		Inventory.PickupMessage "Holy artifact!";
    144 	}
    145 	
    146 	states
    147 	{
    148 		Spawn:
    149 			INSK A -1;
    150 			stop;
    151 		Pickup:
    152 			TNT1 A 0
    153 			{
    154 				GiveHealth(100);
    155 				GiveSpirit(100);
    156 			}
    157 	}
    158 }
    159 
    160 class DivinePower : InvulnerabilitySphere replaces InvulnerabilitySphere
    161 {
    162 	default
    163 	{
    164 		Inventory.PickupMessage "Divine might!";
    165 	}
    166 
    167 	states
    168 	{
    169 		Spawn:
    170 			DORB ABC 6 bright;
    171 			loop;
    172 	}
    173 }
    174 
    175 class CandlePower : Infrared replaces Infrared
    176 {
    177 	default
    178 	{
    179 		Inventory.PickupMessage "Divine might!";
    180 	}
    181 
    182 	states
    183 	{
    184 		Spawn:
    185 			CNVG AB 6;
    186 			loop;
    187 	}
    188 }
    189 
    190 //til I can figure out a replacement
    191 class NewMedikit : DBPickupBase replaces Medikit
    192 {
    193 	states
    194 	{
    195 		Spawn:
    196 			MEDI A -1;
    197 			stop;
    198 		Pickup:
    199 			TNT1 A 0
    200 			{
    201 				GiveHealth(25);
    202 			}
    203 	}
    204 }
    205 
    206 class NewZerk : DBPickupBase replaces Berserk
    207 {
    208 	states
    209 	{
    210 		Spawn:
    211 			PSTR A -1;
    212 			stop;
    213 		Pickup:
    214 			TNT1 A 0
    215 			{
    216 				GiveHealth(100);
    217 			}
    218 	}
    219 }
    220 class Gladiolus : DBPickupBase replaces ArmorBonus
    221 {
    222 	int spiritbonus; 
    223 	Property SpiritBonus : spiritbonus;
    224 	default
    225 	{
    226 		Inventory.PickupMessage "Gladiolus";
    227 		Inventory.Icon "FLO1A0";
    228 		Gladiolus.SpiritBonus 1;
    229 	}
    230 	States
    231 	{
    232 		Spawn:
    233 			TNT1 A 1;
    234 			FLO1 A 1
    235 			{
    236 				int ran = random(1, 6);
    237 				if (ran == 1) { SetStateLabel("Flow1"); }
    238 				if (ran == 2) { SetStateLabel("Flow2"); }
    239 				if (ran == 3) { SetStateLabel("Flow3"); }
    240 				if (ran == 4) { SetStateLabel("Flow4"); }
    241 				if (ran == 5) { SetStateLabel("Flow5"); }
    242 				if (ran == 6) { SetStateLabel("Flow6"); }
    243 			}
    244 		Flow1:
    245 			FLO1 A 1;
    246 			Loop;
    247 		Flow2:
    248 			FLO1 B 1;
    249 			Loop;
    250 		Flow3:
    251 			FLO1 C 1;
    252 			Loop;
    253 		Flow4:
    254 			FLO1 D 1;
    255 			Loop;
    256 		Flow5:
    257 			FLO1 E 1;
    258 			Loop;
    259 		Flow6:
    260 			FLO1 F 1;
    261 			Loop;
    262 		
    263 		Pickup:
    264 			TNT1 A 0
    265 			{
    266 				GiveSpirit(invoker.spiritbonus);
    267 			}
    268 			stop;
    269 	}	
    270 }
    271 
    272 class FLreplaceShells : Gladiolus replaces Shell {}
    273 class FLreplaceClip : Gladiolus replaces Clip {}
    274 class FLreplaceCell : Gladiolus replaces Cell {}
    275 class FLreplaceRocket : Gladiolus replaces RocketAmmo {}
    276 class FLreplaceHBonus : Gladiolus replaces HealthBonus {}
    277 
    278 class Flowers : Gladiolus
    279 {
    280 	default
    281 	{
    282 		Gladiolus.SpiritBonus 10;
    283 	}
    284 	States
    285 	{
    286 		Spawn:
    287 			FLO2 A 1;
    288 			Loop;
    289 	}	
    290 }
    291 
    292 class FLreplaceShellBox : Flowers replaces ShellBox {}
    293 class FLreplaceClipBox : Flowers replaces ClipBox {}
    294 class FLreplaceCellPack : Flowers replaces CellPack {}
    295 class FLreplaceRocketBox : Flowers replaces RocketBox {}
    296 class FLreplaceStimpack : Flowers replaces Stimpack {}
    297 
    298 class MoreFlowers : Gladiolus replaces GreenArmor
    299 {
    300 	default
    301 	{
    302 		Gladiolus.SpiritBonus 50;
    303 	}
    304 	States
    305 	{
    306 		Spawn:
    307 			FLO3 A 1;
    308 			Loop;
    309 	}	
    310 }
    311 
    312 class BigFlowers : Gladiolus replaces BlueArmor
    313 {
    314 	default
    315 	{
    316 		Gladiolus.SpiritBonus 100;
    317 	}
    318 	States
    319 	{
    320 		Spawn:
    321 			FLO3 A 1;
    322 			Loop;
    323 	}	
    324 
    325 }
    326 
    327 class HellContract : DBPickupBase replaces BlurSphere
    328 {
    329 	default
    330 	{
    331 		Inventory.Pickupmessage "You found a contract.";
    332 	}
    333 	
    334 	States
    335 	{
    336 		Spawn:
    337 			SMON ABC 35;
    338 			Loop;
    339 		Pickup:
    340 			TNT1 A 100;
    341 			TNT1 A 1
    342 			{
    343 				GiveSpirit(100);
    344 				vector3 offset = (40,40,0);
    345 				let x = Spawn("ChuckleFuckOne", pos + offset);
    346 				if (x)
    347 				{
    348 					x.master = self;
    349 				}
    350 				
    351 				let y = Spawn("ChuckleFuckTwo", pos);
    352 				if (y)
    353 				{
    354 					y.master = self;
    355 				}
    356 				
    357 				let z = Spawn("ChuckleFuckThree", pos - offset);
    358 				if (z)
    359 				{
    360 					z.master = self;
    361 				}
    362 			}
    363 			stop;
    364 	}	
    365 }