Skip to content
Aaron Gallagher edited this page Feb 20, 2019 · 1 revision

This is the item class for the sundial.

; Item Objects: Sundial (0x10BC)
; The Annotated Unofficial Cythera Sources (TAUCS 1.0.4)
; Commentator: Bryce Schroeder <bryce.schroeder@gmail.com>
; Produced as part of the delv project. 
; http://www.ferazelhosting.net/wiki/Cythera
include Delver.Model
include Delver.Main
include Cythera
use System
resource 0x10BC

field_order (0x04EB, 0x0008, 0x0009, 0x04EB, 0x04EB, 0x04EB, 0x0029)
class Object

; This array has the aspect of the sundial indexed by the 24-hour-time hour.
; It isn't known if the very presence of this array is sufficient to make an
; object behave in this way, or if it also needs some flag set on the tiles.
array AspectByHour(0, 0, 0, 0, 0, 0,
                   1, 1, 2, 2, 3, 4, 
                   5, 6, 7, 7, 8, 8, 
                   0, 0, 0, 0, 0, 0) 

function Use(Self) (
    method Object.Examine
        arg Self
    end 
    return 
        byte 0
    end 
)

function Examine(Var30) (
    if_not 
        global Globals.CurrentHour
        byte 6
        lt 
        global Globals.CurrentHour
        byte 17
        gt 
        or 
    then ItIsDayTime
    'A sundial only works when the sun is visible, thus the name.\n'
    branch End

    ItIsDayTime:
    if_not 
        global Globals.CurrentHour
        byte 12
        eq 
    then NotNoon
    'It says it is noon.\n'
    branch End

    NotNoon:
    if_not 
        global Globals.CurrentHour
        byte 12
        lt 
    then Afteroon
    'It says that it is '
    print 
        global Globals.CurrentHour
    end 
    ' in the morning.\n'
    branch End

    Afteroon:
    'It says that it is '
    print 
        global Globals.CurrentHour
        byte 12
        sub 
    end 
    ' in the afternoon.\n'

    End:
    return 
        byte 0
    end 
)

class_field 1259 none
Clone this wiki locally