04-13-2003, 04:03 PM
>For a barrel that is will explode, the checks could go
>something like this:
Quite good, although the order is not correct :)
>For <spaces 1-8>
>
>If <current space> = empty
> do nothing
This is not done, since if we get to the end, there was nothing and we can move on.
>If <current space> = barrel
>{
> If <barrel> = <exploding barrel>
> <detonate barrel>
The detonation actually includes a full, recursive, call to the handle of a barrel, which in turn will check all the 8 squares surrounding THAT barell.
> Else
> do nothing
>}
These elses are not really needed, although they don't do harm of course.
>If <current space> = <player>
> <possibly damage player>
>
>}
> Also, I only included checks for barrels and players,
>even if the game checks for other things as well. The
>game will also check for enemies around the barrel,
>and will possible damage them as it does a player.
Correct. First it check for a monster. Then it check for a player and finally it check for another exploding barell. Obviously the order is not that important and is of course impossible to know unless you check the code :)
Ohh, the ToHit chances are that of a trap since that is how the attack from the barrel is flaged. See my guide for trap ToHit, I really have no idea about them without checking myself.
>something like this:
Quite good, although the order is not correct :)
>For <spaces 1-8>
>
>If <current space> = empty
> do nothing
This is not done, since if we get to the end, there was nothing and we can move on.
>If <current space> = barrel
>{
> If <barrel> = <exploding barrel>
> <detonate barrel>
The detonation actually includes a full, recursive, call to the handle of a barrel, which in turn will check all the 8 squares surrounding THAT barell.
> Else
> do nothing
>}
These elses are not really needed, although they don't do harm of course.
>If <current space> = <player>
> <possibly damage player>
>
>}
> Also, I only included checks for barrels and players,
>even if the game checks for other things as well. The
>game will also check for enemies around the barrel,
>and will possible damage them as it does a player.
Correct. First it check for a monster. Then it check for a player and finally it check for another exploding barell. Obviously the order is not that important and is of course impossible to know unless you check the code :)
Ohh, the ToHit chances are that of a trap since that is how the attack from the barrel is flaged. See my guide for trap ToHit, I really have no idea about them without checking myself.
There are three types of people in the world. Those who can count and those who can't.