ComputerScienceHouse / ComputerScienceHouse/bingehack

Successful Knock Spell Pointed Down Incorrectly Assumes Bear Trap

Aperta
#129 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
C
Stelle
24
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Knocking open a chest downward produces the message "The bear trap opens. Klick!".
This is not at all indicative, as one might think, of a hitherto undiscovered beartrap that you happen to be standing on, but it is instead a bug, as zapupdown in src/zap.c indicates:

```
case SPE_KNOCK:
/* up or down, but at closed portcullis only */
if (is_db_wall(x,y) && find_drawbridge(&xx, &yy)) {
open_drawbridge(xx, yy);
disclose = TRUE;
} else if (u.dz > 0 && (x == xdnstair && y == ydnstair) &&
/* can't use the stairs down to quest level 2 until
leader "unlocks" them; give feedback if you try */
on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
pline_The("stairs seem to ripple momentarily.");
disclose = TRUE;
} else if (u.utraptype == TT_BEARTRAP) {
pline_The("bear trap opens.");
u.utrap = 0;
}
```

However, TT_BEARTRAP happens to be 0, which apparently what u.utraptype is set to /even if you're not in a trap/.

... this does not appear to be a problem in NetHack 4, where libnethack/zap.c's zapupdown covers this case as:

```
case SPE_KNOCK:
/* up or down, but at closed portcullis only */
if (is_db_wall(x, y) && find_drawbridge(&xx, &yy)) {
open_drawbridge(xx, yy);
disclose = TRUE;
} else if (dz > 0 && (x == level->dnstair.sx && y == level->dnstair.sy)
&&
/* can't use the stairs down to quest level 2 until leader
"unlocks" them; give feedback if you try */
on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
pline("The stairs seem to ripple momentarily.");
disclose = TRUE;
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia in src/zap.c, nel ramo SPE_KNOCK di zapupdown, e confronta la relativa gestione delle bear trap con libnethack/zap.c. Riproduci l'apertura a colpi di una cassa verso il basso, quindi verifica che il messaggio non affermi più che si è aperta una bear trap quando il giocatore non è intrappolato, mentre il comportamento effettivo delle bear trap rimane intatto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c
Ambito
game-dev
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.