Make gun randomly fire stronger projectile that paralyzes?

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
MetroidJunkie
Posts: 709
Joined: Fri Aug 19, 2011 7:27 am

Make gun randomly fire stronger projectile that paralyzes?

Post by MetroidJunkie »

I have a plan to make a weapon that has a 1/4 chance of shooting a more powerful projectile that also paralyzes enemies for a couple of seconds. My questions are, how do you make it randomly switch into another state with a 25% chance and how do you make a projectile cause an enemy to be stunned?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Make gun randomly fire stronger projectile that paralyze

Post by wildweasel »

MetroidJunkie wrote:how do you make it randomly switch into another state with a 25% chance
With something like this:

Code: Select all

PISG A 2 A_Jump(64, "JumpGoesHere")
Bearing in mind that A_Jump chances are from 0 to 256(?), so 64 would be about 25%.
and how do you make a projectile cause an enemy to be stunned?
The way I did this in Weasel Presents Terrorists was by giving every monster a Pain.Taser state where they stand still for several seconds. I made this a little easier on me by putting said state in a parent class (using the "####" keyword instead of the sprite name; this makes the state look at the last sprite chosen), and then having all enemies inherit from that.
User avatar
MetroidJunkie
Posts: 709
Joined: Fri Aug 19, 2011 7:27 am

Re: Make gun randomly fire stronger projectile that paralyze

Post by MetroidJunkie »

Thanks for the help but this uses the existing Doom monsters since it's just a weapons mod. I ended up just replacing each monster individually and putting them in their pain state for the stun duration. Still, thank you for the information. :)
Locked

Return to “Editing (Archive)”