Randomizing attacks
Posted: Tue Nov 10, 2015 6:51 am
So I'm looking to add a bit more randomness to my boss fights when it comes to attacks happening at certain points of their health. I'd like to build a boss that can have certain attacks fire off in different orders each time you face it.
Basically for example at 500 lp the room will have fireballs fall down from the ceiling above, now if you are on your second or third try of the boss you would have figured out the pattern of which they fall and where. I want to make it so when it triggers to fall from the ceiling they will launch down in a different order by using a random check and based on that check activate a particular spawner.
This part I'm able to get down pretty easy using this script
But could I use this random roll code to make it so the phases are randomised? Making it so each time you fight the boss the order of the special attacks are different, or maybe even making it so there are 5 total things that could happen and it runs 3 of them. Of course I would need some way of checking to see if it already ran(wouldn't want them to run a second time(or depending on the attack you would)).
So yea just looking for some feedback and help on it, do you think it could work using that code or would another one be better to use?
Basically for example at 500 lp the room will have fireballs fall down from the ceiling above, now if you are on your second or third try of the boss you would have figured out the pattern of which they fall and where. I want to make it so when it triggers to fall from the ceiling they will launch down in a different order by using a random check and based on that check activate a particular spawner.
This part I'm able to get down pretty easy using this script
Code: Select all
function setatta()
local h = 1
local r = math.random()
if r < 0.3 then
spawner_9.controller:activate()
elseif r < 0.6 then
spawner_10.controller:activate()
else
spawner_11.controller:activate()
end
end
So yea just looking for some feedback and help on it, do you think it could work using that code or would another one be better to use?