Secondary fire gives 5 sec invulnerability?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Reactor
Posts: 2091
Joined: Thu Feb 03, 2011 6:39 pm
Location: Island's Beauty, Hungary

Secondary fire gives 5 sec invulnerability?

Post by Reactor »

This ought to be rather simple, maybe some mods already has it. One of the weapons we thought up would give the player 5 seconds of invulnerability, and would cost 20 units of ammo. The invulnerability itself would be akin to the Doom one, except the screen would simply turn black and white, and NOT negative. This secondary fire-invulnerability could NOT be accumulated (so if the player activates it 3 times, he will not gain 15 seconds of invincibility), and of course, it would not activate if the player has less than 20 units of ammo loaded within the gun. This feature would be great, now players can't whine about "duuuuuuuuuu there R too few invulnerability artifactz, da game iz too hard!!!1!!11!1ONEONEONEELEVEN!"
Needless to say, this invulnerability is useless against bottomless pits, chaos device projectile hit, falling out in space, running out of time, or failing a mission objective.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Secondary fire gives 5 sec invulnerability?

Post by Nevander »

You could do an altfire state which gives the player a powerup item with a 5 second duration that grants invulnerability, and make it so you can only use one at a time and the ammo use of the alt fire is 20.
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Secondary fire gives 5 sec invulnerability?

Post by ramon.dexter »

Altfire state, and some A_JumpIf checks would do the trick. You can even use A_Print to directly print from decorate states.
User avatar
Reactor
Posts: 2091
Joined: Thu Feb 03, 2011 6:39 pm
Location: Island's Beauty, Hungary

Re: Secondary fire gives 5 sec invulnerability?

Post by Reactor »

Very well. And the properties of said invulnerability can be set right there to met the conditions I mentioned?
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Secondary fire gives 5 sec invulnerability?

Post by ramon.dexter »

As I said, you dould do a JumpIf check, make a dummy invisible token item and check for that item. Basically, thats how variables work in decorate - you have to make a item, that acts as a variable.
Locked

Return to “Editing (Archive)”