icon = 'turfs.dmi'
icon_state = "cave floor 1"
cave_floor_1_button //opens the secret door in the cave
icon_state = "cave floor 1 button"
M << "*click!* You hear a rolling in the distance..."
for(D in world)
D.icon_state = "cave floor 1"
D.density = 0
icon_state = "cave wall"
density = 1
I have two questions:
1) Is using a for loop to find the secret door a bad idea? Certainly there must be better ways. If anyone has any suggestions I'd like to hear them.
2) I'm still quite new to DM, so I don't quite understand how everything works yet.
Particularly, I am often thrown off by what arguments to pass into procedures.
In the Entered() proc, for example, what I think I am doing (and what I want to do) is make it so the procedure only executes (correct terminology?) when the hero (the player's character) steps on the button. However, when ANY mob (like a wandering monster) steps on it, the procedure is called.
How do I pass in arguments to Entered() so that only the player(/mob/hero) can open the secret door?
And another question...
fireball(mob/monster/M in oview())
usr << "You hurl a massive fireball at [M]!"
missile(/obj/magic/fireball, usr, M)
density = 1
icon = 'magic.dmi
As it is now, when I use missile() and shoot a fireball at a target, the target is damaged immediately (before the missile actually hits it). I want to use Bump() so that damage calculation doesn't take place until the missile reaches its target. The code which I provided, never actually calls Bump().
Also, I don't know if it's okay to ask multiple questions in one post, or not. I don't have regular access to the internet, so I try to save up my questions and post them when I can. Also, I didn't want to clutter up the board with multiple posts. Please let me know which method is the most appropriate.