Hello!
I am using the S-projectile library.
How can I get mobs to fire back at the players?
Any help would be greatly appreciated!
~GokuSS4Neo~
ID:174405
Aug 19 2003, 5:58 am
|
|
In response to Unknown Person
|
|
Sorry, I didn't make myself very clear. I don't want people to fire backwards, I want the monsters to fire at the players.
~GokuSS4Neo~ |
In response to Gokuss4neo
|
|
In your normal monster wandering code, do a check for players in view(src) and if you find one, fire some stuff at them. You could also wait for a monster to be attacked by a player and cause retaliation in that proc.
|
In response to Jon88
|
|
Jon88 wrote:
In your normal monster wandering code, do a check for players in view(src) and if you find one, fire some stuff at them. You could also wait for a monster to be attacked by a player and cause retaliation in that proc. It's the "fire some stuff at them" that I don't know how to do. I know the rest. Thank you anyway though! ~GokuSS4Neo~ |
In response to Gokuss4neo
|
|
Okay, expanding from Unknown Person's code then...
mob/monster/proc/FireBehind() That will cause a projectile to be fired behind the monster. You could also have a targeted version. mob/monster/proc/FireAtEnemy(mob/M) |
In response to Jon88
|
|
Thank you!
~GokuSS4Neo~ |
var/obj/projectile/P = new(get_step(src,turn(src.dir,180)))
walk(P,turn(src.dir,180))
This will make the projectile behind you and walk the opposite direction.