#Party accidentally falls into a trap
from eventAPI import *
from APIUtils import *

DKPlot1 = 0

def fireEvent(e):
    global DKPlot1
    DKPlot1 = getTag(e, "DKPlot1")
    if (DKPlot1 == 0):
        trap(e)
    else:
        hole(e)

def trap(e):     
    showMessage(e, ["As you are walking, the ground gives way beneath you, hurtling you to the depths below."])
    tickGame(e, 60)
    x, c = 0, getPartyCount(e)
    while (x < c):
        modifyHP(e, x, -dice(1, 6, 0))
        x += 1
    setExit(e, "maps/DK_Cave.cfg", 12, 2, 0)
    return 0


def hole(e):
    if (poseYesNo(e,
  ["There is a hole in the ground, leading to some caves below.",  "Do you jump down?"])):
        tickGame(e, 60)
        setExit(e, "maps/DK_Cave.cfg", 12, 2, 0)
    return 0