Loading

Paste #pmjggsh99

  1.   if self.falling_anim and self:canPeeOrPuke(current) and self.has_fallen == 1 then
  2.     self:setNextAction(FallingAction():setMustHappen(), 0)
  3.     self.has_fallen = 2
  4.     if self.has_fallen == 2 then
  5.       self:setNextAction{name = "on_ground"}
  6.       self.on_ground = true
  7.     end
  8.       if self.on_ground then
  9.         self:setNextAction{name = "get_up"}
  10.       end
  11.       if current.name == "idle" or current.name == "walk" then
  12.         self:queueAction({
  13.           name = current.name,
  14.           x = current.x,
  15.           y = current.y,
  16.           must_happen = current.must_happen,
  17.           is_entering = current.is_entering,
  18.         }, 2)
  19.       else
  20.       self:queueAction({
  21.         name = current.name,
  22.         room_type = current.room_type,
  23.         message_sent = true,
  24.         diagnosis_room = current.diagnosis_room,
  25.         treatment_room = current.treatment_room,
  26.       }, 2)
  27.       end
  28.       if current.on_interrupt then
  29.         current.on_interrupt(current, self)
  30.       else
  31.       self:finishAction()
  32.       end
  33.       self.on_ground = false
  34.       if math.random(1, 5) == 3 then
  35.         self:shake_fist()
  36.       end
  37.       self:fallingAnnounce()
  38.       self:changeAttribute("happiness", -0.05) -- falling makes you very unhappy
  39.   else
  40.     return
  41.   end

Comments