(version 2)
(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Obj")
(script 899)



(procedure (localproc_0004 param1 param2 param3)
    (send param1:param2(rest param3))
)


(class NewFeature of Obj
    (properties
        x 0
        y 0
        z 0
        heading 0
        noun 0
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        description 0
        sightAngle 90
        getableDist 50
        seeableDist 100
        shiftClick 0
        contClick 0
        lookStr 0
    )

    (method (init)
        (send gFeatures:add(self))
        (if (not shiftClick)
            = shiftClick 369
        )
    )


    (method (handleEvent pEvent)
        (var temp0)
        (if ((send pEvent:claimed))
            return 1
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said(noun))
                    (send pEvent:claimed(0))
                    return 
                        (if ((> Abs((- GetAngle((send gEgo:x) (send gEgo:y) x y) (send gEgo:heading))) sightAngle) or (> GetDistance((send gEgo:x) (send gEgo:y) x y) seeableDist))
                            (self:dontSee())
                            (send pEvent:claimed(1))
                        )(else
                            (if (Said('look,look'))
                                (self:doLook())
                            )(else
                                (if (> GetDistance((send gEgo:x) (send gEgo:y) x y) getableDist)
                                    (self:notClose())
                                    (send pEvent:claimed(1))
                                )(else
                                    (if (Said('move,move'))
                                        (self:doMove())
                                    )(else
                                        (if (Said('get,get'))
                                            (if (contClick)
                                                (self:doGet())
                                            )(else
                                                (send pEvent:claimed(0))
                                            )
                                        )
                                    )
                                )
                            )
                        )
                )
            )
            (case 1
                = temp0 (send pEvent:modifiers)
                (if (not temp0)
                )(else
                    (if (not 
                    (if (((<= nsLeft (send pEvent:x)) and (<= (send pEvent:x) nsRight)) and (<= nsTop (send pEvent:y)))
                        <= (send pEvent:y) nsBottom
                    )
)
                    )(else
                        (if (& temp0 $0003)
                            localproc_0004(self shiftClick)
                            (send pEvent:claimed(1))
                        )
                    )
                )
            )
        )
        return (send pEvent:claimed)
    )


    (method (doLook)
        (if (lookStr)
            proc255_0(lookStr)
        )(else
            proc255_4(899 2 description description)
        )
    )


    (method (doMove)
        proc255_4(899 3 description)
    )


    (method (doGet)
        proc255_4(899 4 description)
    )


    (method (dontSee)
        proc255_4(899 0 description)
    )


    (method (notClose)
        proc255_4(899 1 description)
    )

)
