ID:180414
 
Help Plz Im using attack code that looks like this

verb
attack(M as mob in oview(1))
if (M:HP <= 0)
usr << "\red [M] Is dead"
else
usr << "You attack [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M:HP -= damage
M:DeathCheck()

I need help making this into a Click() Function?
On 6/30/01 5:28 pm DoOmBringer wrote:
I need help making this into a Click() Function?

Use the Demos link on the left, and check out the Walking & Clicking demo.
In response to Deadron
On 6/30/01 6:01 pm Deadron wrote:
On 6/30/01 5:28 pm DoOmBringer wrote:
I need help making this into a Click() Function?

Use the Demos link on the left, and check out the Walking & Clicking demo.

Thats not wat i want a thing like

Mob on click thing (Not use to this type of code)

such as

Mob on click attack?
In response to DoOmBringer
On 6/30/01 8:44 pm DoOmBringer wrote:
On 6/30/01 6:01 pm Deadron wrote:
On 6/30/01 5:28 pm DoOmBringer wrote:
I need help making this into a Click() Function?

Use the Demos link on the left, and check out the Walking & Clicking demo.

Thats not wat i want a thing like

Mob on click thing (Not use to this type of code)

such as

Mob on click attack?

Here's the proc:

mob/Click()


Here's the relevant variables in that situation:

usr is the attacker
src is the defender
In response to Spuzzum

Click(M as mob in oview(1))
if (M:HP <= 0)
usr << "\red [M] Is dead"
else
usr << "You attack [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M:HP -= damage
M:DeathCheck()
In response to Vortezz
On 6/30/01 9:49 pm Vortezz wrote:
Click(M as mob in oview(1))
if (M:HP <= 0)
usr << "\red [M] Is dead"
else
usr << "You attack [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M:HP -= damage
M:DeathCheck()

Nope, that's not right.

mob/Click()
if(src.HP <= 0)
usr << "\red [src] is dead!"
else
usr << "You attack [src]!"
var/damage = rand(1,10)
view() << "[damage] damage!"
src.HP -= damage
src.DeathCheck()
In response to Spuzzum
On 7/1/01 2:14 am Spuzzum wrote:
On 6/30/01 9:49 pm Vortezz wrote:
Click(M as mob in oview(1))
if (M:HP <= 0)
usr << "\red [M] Is dead"
else
usr << "You attack [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M:HP -= damage
M:DeathCheck()

Nope, that's not right.

mob/Click()
if(src.HP <= 0)
usr << "\red [src] is dead!"
else
usr << "You attack [src]!"
var/damage = rand(1,10)
view() << "[damage] damage!"
src.HP -= damage
src.DeathCheck()


I tried this is says proc definition not allowed inside another proc
In response to DoOmBringer

I tried this is says proc definition not allowed inside another proc

Try it not inside another proc.
In response to LexyBitch
On 7/1/01 7:05 am LexyBitch wrote:
I tried this is says proc definition not allowed inside another proc

Try it not inside another proc.

Lexy's statements are getting shorter and sweeter. =)


Read the section in the Guide about procs. If you're making a proc, it needs to be at the proper indentation. Otherwise it assumes you're making a proc inside of your current proc, which makes no sense and is not allowed.