Skip to content

Commit

Permalink
Ninja: Update help.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozar committed Oct 28, 2021
1 parent b1ca9ba commit 0b550e6
Showing 1 changed file with 89 additions and 36 deletions.
125 changes: 89 additions & 36 deletions user/doc/ninja.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,110 @@
> - Sorry, love. My heart has no room for another lady. She would slow me down.
> - If so, let me be the bone of your sword.
>
> An ordinary salaryman is now possessed by an ancient and powerful ninja soul. Can he kill all the ninjas in a Naraku Time to revenge for his wife and child?
> An ordinary salaryman is now possessed by an ancient and powerful ninja soul. Can he kill all ninjas in a Naraku Time to revenge for his wife and child?
You need to kill all ninjas in one turn. You have at most 24 turns and there is no way to restore turns. You lose the game either due to running out of time or being killed by a ninja. There are several hand crafted maps. Each of them contains grids that might be occupied by walls.
To beat the game, you need to stop time and kill all ninjas before time starts to flow again. You lose the game either due to running out of time or being hit the second time by a ninja.

## Move, Approach, Bump & Kill
## Dungeon Environment

Press arrow keys to move into an unoccupied grid, approach an NPC, or bump into an adjacent NPC. Your interaction with an NPC varies according to the NPC's state. A ninja has two states: default (N) and passive (n). When you approach or bump into a ninja in default state, he becomes passive and steps back 1 grid automatically if possible.
The dungeon is composed of three columns. The left and right columns are indicators to show your current level. An empty row means you are at an empty grid. A row with question marks (?) means you are at a grid with a soul fragment, of which the symbol is also a question mark (?).

. . . . When PC moves into grid 1, the
@ 1 N 2 ninja steps back to grid 2. The
. . . . ninja cannot move if grid 2 is
occupied by a wall or another
ninja.
The middle column is battle ground. When the game starts, you stand on a static platform at the bottom of an elevator shaft. Underneath the platform is your health bar. The bar has 2 blocks. When you take 1 hit from a ninja, the right block is depleted. The second hit depletes the left block and kills you.

You can bump into 1 ninja at a time, but you can approach at most 3 ninjas with a single move.
## PC Moves outside Time Stop

. A a . When PC moves into grid 1, all
@ 1 B b 3 ninjas, A, B and C, are
. C c . pushed back by 1 grid to a, b
and c respectively.
### PC Stands on Ground

When you approach or bump into a ninja in passive state, you kill the ninja. A dead ninja leaves one or more soul fragments (?) behind. A soul fragment lasts at most 8 turns. When its symbol becomes an exclamation mark (!), it means the fragment will disappear at the end of the current turn. Newly created fragments replace existing ones and reset the duration.
When standing on ground, press left or right arrow key to move 1 step horizontally, and press up arrow key to jump 2 grids upwards. Down arrow key has no effect in this case.

If you bump into a passive ninja, your victim leaves a soul fragment where he stands. If you approach a passive ninja, the ninja is pushed back by 1 grid if possible and then leaves at most 5 fragments. You can approach and kill at most 3 ninjas with one move in the same way mentioned above.
If your path is blocked by a ninja (left, right, or within 2 grids upwards), you stop right before the ninja, hit him and stop time (more on this below: *PC Moves inside Time Stop*, *PC Hits a Ninja*); otherwise you move to the destination, your turn ends and the countdown timer on the top right corner of the screen reduces by 1 turn. If you do not want to move, press Space to wait 1 turn. You have at most 24 turns. The game ends when you are running out of time.

. . . . . When PC moves into grid 1,
@ 1 n . . the ninja is pushed back and
. . . . . killed. He leaves soul
fragments in grids marked with
. . . ? . question marks.
. @ ? ? ?
. . . ? .
Press left/right to hit ninja 1 or move to grid 2.

Press Space to wait 1 turn.
1 @ 2
# # #

## Naraku Time
Press up to hit ninja 3/4, or to jump to grid 5.

You can enter Naraku time only by being adjacent to a passive ninja. When in Naraku time, you act normally but ninjas cannot act except step back responsively. Besides, your symbol turns into a number which shows your remaining ticks. Initially you have 9 ticks. The maximum tick decreases by 1 every 6 turns.
. | 4 | 5
3 | . | .
@ | @ | @
# | # | #

* 9 ticks: Turn 24 - 19
* 8 ticks: Turn 18 - 13
* 7 ticks: Turn 12 - 7
* 6 ticks: Turn 6 - 1
### PC Floats in Mid-air

The turn counter is frozen so long as you have ticks left. When you are running out of ticks, you leave Naraku time and your current turn ends. You can also leave early by pressing Space.
When floating in mid-air, 2 grids right below you turn into short dashes. They are your falling trajectory. Besides, if there is a soul fragment in the trajectory, its symbol changes from a question mark (?) to an exclamation mark (!).

Move into a grid that is not covered by a soul fragment costs 1 tick. Actions below cost no tick.
Press left or right arrow key to move 1 step horizontally and then fall down 2 grids. Press down arrow key to fall down 2 grids without moving horizontally. Press Space also results in falling down 2 grids, but you cannot hit a ninja in this way, see below. Up arrow key has no effect in this case.

* Move into a grid with a soul fragment.
* Approach or bump into a ninja.
Similarly as above, if your path is not blocked by a ninja, you spend 1 turn to move to the destination; otherwise you hit the ninja and stop time unless you press Space key.

## NPC AI & Enemy Respawn
Press right to hit ninja 1/2/3 or move to grid 4.

A ninja approaches PC by 1 step if he is close to PC. The maximum range equals to (6 + 2 * (dead ninjas in the last turn)). He can also one shot kill PC in melee. At the start of a turn, a ninja resets to default state and new ninjas respawn around PC.
@ 1 | @ . | @ . | @ .
. . | . 2 | . . | . .
. . | . . | . 3 | . 4
. . | . . | . . | . .

Press down to hit ninja 5/6 or move to grid 7.

@ | @ | @
5 | . | .
. | 6 | 7
. | . | .

If grid 8 is occupied by a ninja, press Space to move to grid X, otherwise to move to grid 8.

@
X
8
.

## PC Moves inside Time Stop

When you hit a ninja outside time stop, you freeze the countdown timer immediately and your symbol turns into a digit. It shows how many remaining ticks you have in the current stop. You have at most 4 ticks.

Press left or right arrow key to move 1 step horizontally, and up or down arrow key to move 2 grids vertically. If you hit a ninja in the way or the first grid in your path has a soul fragment (As mentioned above, its symbol is a question mark (?).), this moving or attacking costs no tick, otherwise your tick is reduced by 1. You end your current turn when there is no ticks left. You can also press Space to let time flow right away.

## PC Hits a Ninja

If a ninja blocks your moving path, you stop right before the ninja, hit him, remove him from the game, and stop time. Besides, a dead ninja may leave a soul fragment behind. The soul fragment is shown as a question mark (?). Its symbol turns into a exclamation mark (!) when it is in a falling trajectory.

There are two types of ninjas: common ninja (N, n) and shadow ninja (S, s). An uppercase letter means the ninja is on a grid that has a soul fragment. A common ninja leaves behind a fragment if there are no shadow ninjas on the same row or column with him. A shadow ninja leaves nothing behind. If there is a fragment beneath him, he removes it when killed.

## Ninja AI

### General AI

All ninjas act after PC. If a ninja neither moves nor attacks in his turn, he will be removed at the end of PC's next turn. (See an example below.) A ninja has a falling trajectory that is 2 grids long just as PC. He falls down at the end of his turn.

* Turn 1: [PC acts.] -- [Ninja 1 waits.] -- [Ninja 2 acts.]
* Turn 2: [PC acts.] -- [Ninja 1 is removed after PC's action.] -- [Ninja 2 acts.]

### Common Ninja AI

A common ninja may perform one of three actions at the start of his turn.

Action 1. Hit PC and deal 1 point of damage if he is adjacent to PC. His symbol changes from n to x for one turn.

Action 2. When on ground, jump up if there is at least one unoccupied grid above, otherwise try to move 1 step horizontally towards PC. A ninja can jump at most 2 grids high. PC is hit if he blocks the jumping path. If another NPC blocks the vertical or horizontal path, the ninja cannot move to his destination.

Action 3. When in mid-air, if the vertical distance between the ninja and PC is no more than 2 grids, try to move 1 step horizontally towards PC first and then try to fall down 2 grids; otherwise try to fall down 2 grids. Same as action 2, PC is hit if he blocks the way, and the ninja can be blocked by his allies.

### Shadow Ninja AI

At the start of a shadow ninja's turn, if there is a soul fragment under him, the fragment is removed. Then he may perform one of two actions.

Action 1. When in mid-air, fall down 2 grids if possible.

Action 2. When on ground, try to move 1 step horizontally towards PC. Do not move if he is already in the same column with PC.

So long as the shadow ninja is alive, a common ninja does not leave a soul fragment when killed if he is on the same row or column with the shadow ninja. When the shadow ninja is killed by PC, if there is a soul fragment under him, he removes the fragment.

Removing a common or shadow ninja due to being idle for 1 turn (see above, *General AI*) does not add or remove a soul fragment.

## Respawn Ninjas

The elevator shaft holds at most 13 ninjas. If the number of ninjas does not reach its maximum, new ones appear at the top three rows of the shaft when PC's turn ends. There can be at most 4 new common ninjas every turn. If currently there are fewer than 4 shadow ninjas, one of the common ninjas is replaced by a shadow ninja. Respawning a shadow ninja has a higher priority over a common one.

In order to beat the game, first you need to hit a ninja and enter time stop. Then you have to kill all remaining ninjas, the number of which ranges from 3 to 12, within 4 ticks.

0 comments on commit 0b550e6

Please sign in to comment.