ID:159143
 
Ok...here is what Im wondering, for a friend Im helping he is trying to make it so that when you punch/Shoot someone, they move backwards (This part is already figured out), however, if they get hit into a Wall, they take extra damage (and I dont want to make it so when they hit a wall it, the wall does damage, I want it so that the Punch/Shot will do the extra)...

Gah x.x; Im kinda explaining it weird, if so just ask for more info and I'll try to make it clearer...anyways, if someone could help me, that would be Uberly cool ^^;
Matt3151 wrote:
How do you check if a Dens Turf is behind someone?

Easy enough. You can turn() their dir 180 degrees and then use get_step() to get the turf at that direction from then, from where you can proceed to do whatever you want with that turf (or even its contents).

if they get hit into a Wall, they take extra damage

Depending on your specific wants, you could take this one directly from the Move() (or step()) call used to move the mob in the first place, by checking its return value - which will be false if the movement failed. By default, it will fail if he has bumped into anything, though it can be influenced by Enter()/Exit() overrides.
In response to Kaioken
Zomg :D Thanks so much!

I didnt even think of using the turn command like that ^^;
Im going to go with the first one, while the second one does work, the first one seems like it will work for what Im using it for (might not like the result of pushing someone into a door xD)
In response to Matt3151
Or if you wanted to you could go and add something to move() that if you hit a solid turf then it checks if hitshot=1 (which it will until the end of the shot being processed) and if it is 1 then it deals damage, then it changes it back to 0.
In response to VolksBlade
VolksBlade wrote:
Or if you wanted to you could go and add something to move() that if you hit a solid turf then it checks if hitshot=1

There's no way to determine what a movable has hit (if any) in Move() itself any better than anywhere else, unless you reprogram Move() or its bumping part yourself. Note irregardless in such a case an object var, as what seems you're implying, wouldn't be required as you could just pass an argument to the proc.
In response to Kaioken
Eh, just thought I would toss it out there though.