mob/proc/Attack()
Could someone possibly demonstrate/guide me through the making of such proc to attack only whats in front of your mob(0 spaces away)? Maybe even show an overlay on the target?
~Zlegend~
ID:171630
Aug 29 2004, 10:09 am
|
|
I have no idea where to start here except putting
mob/proc/Attack()
Could someone possibly demonstrate/guide me through the making of such proc to attack only whats in front of your mob(0 spaces away)? Maybe even show an overlay on the target? ~Zlegend~ |
You can use the get_step() proc to find the turf that's in front of your mob. Once you have that turf stored in a variable (let's call it T), you need to try and find something to attack in it.
Once you have your /mob, /mob/monster, or whatever, you need to do the actual attacking. BYONDscape has some tutorials with basic attack procedures for causing damage, removing health, checking for death, etc.
If you want to show a targetting overlay over something, you can use image objects to do it. You'll need to create the image object, and you'll need a variable to store it in so you can easily delete it later.
That's an example of one (possibly buggy) way to show a targetting overlay over what you're attacking. It has some problems such as the overlay will stay on a mob until you attack another one. So a player could possibly run away from a battle, and come back later and see his targetting overlay on top of what he was attacking a while earlier.