In Inform 5.5 that would be:
Object bell "doorbell"
has static
with name "bell" "doorbell",
number 0,
before [;
Push:
self.number = self.number + 1;
switch(self.number) {
1: "The door shakes.";
2: "The door is really wobbly.";
default: deadflag = 1; "The door falls on you.";
}
];
-- Gareth Rees