ID:146967
 
How do I change the below code to a bump form instead of click, (meaning, i want you to have to bump the enemy to call the proc attack on it)
mob
monster
Click()//click on a monster to...
usr.attack(src)//..attack
KingSerpent wrote:
How do I change the below code to a bump form instead of click, (meaning, i want you to have to bump the enemy to call the proc attack on it)
> mob
> monster
> Click()//click on a monster to...
> usr.attack(src)//..attack
>


uh...
mob
monster
Bump()
usr.attack(src)

I believe, lol
In response to Lenox
lol you think i wouldnt have tried that? it doesnt work :/ i dont know why, youd think it would
In response to KingSerpent
KingSerpent wrote:
lol you think i wouldnt have tried that? it doesnt work :/ i dont know why, youd think it would

Ah, it really should work..maybe try switching usr with src? /shrug
In response to Lenox
mob
monster
Bump(mob/M)
if(M.client)
src.attack(M)

Try that...
In response to Lenox
well i have a better solution, im making it a verb instead of a bump.... but, another problem, when i go up to attack a monster, it gives me a list, the monster, and the user, how do i make the user disapear from the list?

here is the code:
mob
verb
Attack(mob/M as mob in view(2))
if(istype(M,/mob/monster))
usr.attack(src)
else
In response to Hell Ramen
I dont want click anymore, sides, that didnt work, Look at the well post i just made
In response to KingSerpent
use src instead of usr, and do (The List) -= src
In response to Lenox
Yes, M-=src
In response to Hell Ramen
Actually, do:
mob
verb
Attack(mob/monster/M as mob in view(2))
//Insert attack proc here, don't call it, put it here.
In response to KingSerpent
Use oview() instead of view(). View() includes the center, where the attacker is. Oview includes everything but the center.
> mob
> verb
> Attack(mob/M as mob in oview(2))
> if(istype(M,/mob/monster))
> usr.attack(src)
> else
>


~X
In response to KingSerpent
Did you make the Bump Proc


mob
Bump(atom/O)
if(istype(O,/mob/Slime))
O:Attack()


Then do the attack system.