Make gun randomly fire stronger projectile that paralyzes?
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.
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.
- MetroidJunkie
- Posts: 709
- Joined: Fri Aug 19, 2011 7:27 am
Make gun randomly fire stronger projectile that paralyzes?
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?
- 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
With something like this:MetroidJunkie wrote:how do you make it randomly switch into another state with a 25% chance
Code: Select all
PISG A 2 A_Jump(64, "JumpGoesHere")
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.and how do you make a projectile cause an enemy to be stunned?
- MetroidJunkie
- Posts: 709
- Joined: Fri Aug 19, 2011 7:27 am
Re: Make gun randomly fire stronger projectile that paralyze
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. 
