oh add_press_ready can happen before OR after on_begin, that's annoying
I'll just have to make it so transmuting a trap to non-trap then back to trap might leave it in a weird amount-of-presses state if you do Shenanigans until I can think of a better solution
This commit is contained in:
parent
64e51d6a62
commit
e60423e8c0
@ -1489,11 +1489,13 @@ const TILE_TYPES = {
|
|||||||
trap: {
|
trap: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
on_begin(me, level) {
|
on_begin(me, level) {
|
||||||
level._set_tile_prop(me, 'presses', 0);
|
if (me.presses === undefined) {
|
||||||
|
level._set_tile_prop(me, 'presses', 0);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
add_press_ready(me, level, other) {
|
add_press_ready(me, level, other) {
|
||||||
// Same as below, but without ejection
|
// Same as below, but without ejection
|
||||||
level._set_tile_prop(me, 'presses', me.presses + 1);
|
level._set_tile_prop(me, 'presses', (me.presses ?? 0) + 1);
|
||||||
},
|
},
|
||||||
// Lynx (not cc2): open traps immediately eject their contents on arrival, if possible
|
// Lynx (not cc2): open traps immediately eject their contents on arrival, if possible
|
||||||
add_press(me, level, is_wire = false) {
|
add_press(me, level, is_wire = false) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user