(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "SQRoom")
(use "Polygon")
(use "Class_950_0")
(use "Cycle")
(use "Obj")
(script 35)


(local
    local0[10] = (0 85 12 77 10 40 50 )
    local10[12] = (60 36 79 38 109 30 85 9 71 14 60 31 )
    local22[44] = (12 67 11 40 51 0 318 0 319 189 275 189 297 163 226 113 193 151 201 167 141 187 121 169 198 93 147 56 121 91 126 104 75 124 57 107 124 39 80 5 57 34 65 50 )
    local66[16] = (0 84 10 79 11 70 14 68 140 187 156 186 164 189 0 189 )
    local82[18] = (13 67 24 64 26 60 65 51 61 38 78 39 111 32 124 38 57 108 )
    local100[16] = (75 125 86 124 88 119 128 105 120 90 147 58 198 93 122 168 )
    local116[16] = (164 189 156 185 157 183 202 166 194 151 226 114 297 165 273 189 )

)
(instance public rm035 of SQRoom
    (properties
        picture 35
        style 30
        south 50
        west 30
        vanishingX 65411
        vanishingY 65424
    )

    (method (init)
        (switch (gWest)
            (case 45
                (send gEgo:
                    init()
                    x(48)
                    y(245)
                )
                proc0_2()
                (self:setScript(enterScript))
            )
            (case south
                (send gEgo:x(245))
            )
            (case east
                0
            )
            (default 
                (send gEgo:
                    x(160)
                    y(130)
                )
            )
        )
        (rubblePoly1:
            points(@local0)
            size(5)
        )
        (rubblePoly2:
            points(@local10)
            size(6)
        )
        (buildingPoly:
            points(@local22)
            size(22)
        )
        (streetPoly:
            points(@local66)
            size(8)
        )
        (sidewalk1Poly:
            points(@local82)
            size(9)
        )
        (sidewalk2Poly:
            points(@local100)
            size(8)
        )
        (sidewalk3Poly:
            points(@local116)
            size(8)
        )
        (send global2:addObstacle((send ((Polygon:new())):
                type(2)
                init(238 152 230 163 163 189 126 189 110 174 129 155 209 144)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(38 110 126 79 158 103 71 135)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(0 0 319 0 319 189 306 189 298 173 108 35 86 39 92 43 81 51 0 80)
                yourself()
            )
))
        (send gEgo:init())
        (theRubble1:init())
        (theRubble2:init())
        (theWhiteBldg:init())
        (theStreet:init())
        (sidewalk1:init())
        (sidewalk2:init())
        (sidewalk3:init())
        (theArea:init())
        (self:setRegions(701))
        (super:init())
        (self:setRegions(705))
    )


    (method (newRoom param1)
        (if ((((<> (send global2:script) ScriptID(701 3)) and (<> (send (ScriptID(701 1)):script) ScriptID(701 4))) and (== (send gEgo:edgeHit) 3)) and (< (send gEgo:x) 124))
            = param1 45
        )
        (super:newRoom(param1))
    )

)
(instance enterScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gEgo:setMotion(MoveTo 78 188 self))
            )
            (case 1
                proc0_3()
                (send client:setScript(0))
            )
        )
    )

)
(instance theRubble1 of Feature
    (properties
        x 11
        y 18
        description "rubble"
        sightAngle 45
        lookStr "The clearing ends here. Progress north is not possible over the jagged terrain."
    )

    (method (init)
        (super:init())
        (self:onMeCheck(rubblePoly1))
    )


    (method (doVerb param1)
        (switch (param1)
            (case 2
                Print("The rubble is rough and jagged. Your hide wasn't designed to traverse this kind of terrain.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance rubblePoly1 of Polygon
    (properties)
)
(instance theRubble2 of Feature
    (properties
        x 82
        y 22
        description "rubble"
        sightAngle 45
        lookStr "The clearing ends here. Progress north is not possible over the jagged terrain."
    )

    (method (init)
        (super:init())
        (self:onMeCheck(rubblePoly2))
    )


    (method (doVerb param1)
        (switch (param1)
            (case 2
                Print("The rubble is rough and jagged. Your hide wasn't designed to traverse this kind of terrain.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance rubblePoly2 of Polygon
    (properties)
)
(instance theWhiteBldg of Feature
    (properties
        x 350
        y 180
        description "white building"
        lookStr "A fairly intact but featureless dirty white structure fills space to the east."
    )

    (method (init)
        (super:init())
        (self:onMeCheck(buildingPoly))
    )

)
(instance buildingPoly of Polygon
    (properties)
)
(instance theStreet of Feature
    (properties
        description "street"
        lookStr "As is often the case in road design, as many features were designed out as possible to make it an event-free experience."
    )

    (method (init)
        (super:init())
        (self:onMeCheck(streetPoly))
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 10
                Print("It tastes like you've just scraped your tongue to shreds on the pavement.")
            )
            (case 11
                Print("The rich aroma of hovercar exhaust fills your sinuses.")
            )
            (case 3
                (send (ScriptID(705 4)):doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance streetPoly of Polygon
    (properties)
)
(instance sidewalk1 of Feature
    (properties
        description "sidewalk"
    )

    (method (init)
        (super:init())
        (self:onMeCheck(sidewalk1Poly))
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                Print("holy cowIt looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.It looks like a surface suited for foot travel.")
            )
            (case 10
                Print("It tastes like all the other sidewalks you've ever tasted.")
            )
            (case 11
                Print("It smells mostly of dust and dirt.")
            )
            (case 3
                (send (ScriptID(705 4)):doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance sidewalk1Poly of Polygon
    (properties)
)
(instance sidewalk2 of Feature
    (properties
        description "sidewalk"
    )

    (method (init)
        (super:init())
        (self:onMeCheck(sidewalk2Poly))
    )


    (method (doVerb param1 param2)
        (sidewalk1:doVerb(param1 param2))
    )

)
(instance sidewalk2Poly of Polygon
    (properties)
)
(instance sidewalk3 of Feature
    (properties
        description "sidewalk"
    )

    (method (init)
        (super:init())
        (self:onMeCheck(sidewalk3Poly))
    )


    (method (doVerb param1 param2)
        (sidewalk1:doVerb(param1 param2))
    )

)
(instance sidewalk3Poly of Polygon
    (properties)
)
(instance theArea of Feature
    (properties
        nsBottom 200
        nsRight 320
        description "area"
        lookStr "You are at the northeastern boundary of a clearing in the midst of a battle-scarred city. The massive wart-like complex in the background is the only thing in sight which appears to contain life."
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (send (ScriptID(705 4)):doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
