Secondary fire gives 5 sec invulnerability?

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Secondary fire gives 5 sec invulnerability?

Postby Reactor » Mon Sep 25, 2017 7:14 pm

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.
User avatar
Reactor
The militarist
 
Joined: 03 Feb 2011
Location: Island's Beauty, Hungary

Re: Secondary fire gives 5 sec invulnerability?

Postby Nevander » Mon Sep 25, 2017 11:29 pm

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.
Nevander
Banned User
 
Joined: 06 Jan 2014

Re: Secondary fire gives 5 sec invulnerability?

Postby ramon.dexter » Tue Sep 26, 2017 8:48 am

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
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia

Re: Secondary fire gives 5 sec invulnerability?

Postby Reactor » Tue Sep 26, 2017 12:52 pm

Very well. And the properties of said invulnerability can be set right there to met the conditions I mentioned?
User avatar
Reactor
The militarist
 
Joined: 03 Feb 2011
Location: Island's Beauty, Hungary

Re: Secondary fire gives 5 sec invulnerability?

Postby ramon.dexter » Wed Sep 27, 2017 12:06 am

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.
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 2 guests