Module:BassaridianCalendar: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
NewZimiaGov (talk | contribs)
No edit summary
NewZimiaGov (talk | contribs)
No edit summary
Tag: Manual revert
Line 2: Line 2:


function p.getCurrentDate()
function p.getCurrentDate()
    -- Constants
     local startDate = os.time({year = 1999, month = 8, day = 6})
     local startDate = os.time({year = 1999, month = 8, day = 6}) -- August 6, 1999
     local secondsInDay = 86400
     local secondsInDay = 86400
     local daysPerYear = 183
     local daysPerYear = 183


    -- Current date
     local currentDate = os.time()
     local currentDate = os.time()
     local totalDaysElapsed = math.floor((currentDate - startDate) / secondsInDay)
     local totalDaysElapsed = math.floor((currentDate - startDate) / secondsInDay)


    -- Calculate PSSC year and day
     local yearFraction = totalDaysElapsed / daysPerYear
     local yearFraction = totalDaysElapsed / daysPerYear
     local psscYear = math.floor(yearFraction)
     local psscYear = math.floor(yearFraction)
     local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1
     local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1


    -- Proverb lookup table for all 183 days
     local zodiacProverbs = {
     local proverbs = {
         Atosien = "The first light reveals the sacred cycle of renewal.",
         "In the first light of Atosiel, the world begins anew.",
         Eosena = "The dawn whispers: every step is a rebirth.",
        "Day two reminds us that clarity grows with patience.",
         Micrasha = "Wisdom is the balance of shadow and flame.",
        "Balance is the seed from which harmony flourishes.",
         Pyreska = "Creation ignites in the fires of transformation.",
        "The spark of creation burns within us all.",
         Indomin = "Two paths intertwine: strength in unity, clarity in duality.",
        "Unity is forged in the trials of duality.",
         Chrysen = "Gold is the soul's test: will you hoard or share?",
        "The radiant sun casts shadows to teach perspective.",
         Thalassian = "The tides of Thalassiel teach patience and purpose.",
        "Wisdom is the path lit by disciplined thought.",
         Nephelia = "Dreams are stars, fleeting yet eternal in the night sky.",
         "The essence of dawn is rebirth, day after day.",
         Glinaeus = "The frost preserves what must endure.",
         "To embrace harmony, one must first hear dissonance.",
         Noctien = "Night guides those who seek the unseen truths.",
        "In the heat of fire lies the promise of renewal.",
         Opsithia = "The harvest feeds not just the body, but the spirit.",
        "Strength and balance are siblings of the spirit.",
         Stygian = "Through the Styx flows the essence of transformation.",
         "On the twelfth day, Atosiel sings the hymn of beginnings.",
         Faunian = "The forests sing of life and the balance it brings.",
        "Eosena whispers, 'Every sunrise is a step forward.'",
         Silenian = "Celebration is the nectar of divine abundance.",
        "The tides of thought guide the creative heart.",
         Catosien = "Order shapes greatness; the straight path ascends."
        "Flame dances to the rhythm of transformation.",
         "Truth lies not in words but in their echoes.",
        "Balance is the quiet axis of chaos.",
        "In stillness, one discovers the nature of the storm.",
        "Wisdom humbles even the brightest star.",
        "Each moment is an ember awaiting the breath of life.",
        "Day twenty-two carries the light of reflection.",
         "Harmony is a chord played on the strings of time.",
        "Pyreska’s flame tempers the soul with resilience.",
        "Strength arises not from might but from resolve.",
        "Day thirty reveals the shape of justice in symmetry.",
         "The dual path teaches choice; the chosen path teaches resolve.",
        "The cycle begins again with the harvest of Atosiel’s gifts.",
        "To hold light is to cast shadows that teach others to grow.",
        "The heart of the flame knows neither greed nor fear.",
        "The roots of truth run deepest in the soil of challenge.",
        "Chrysen’s golden glow lights the paths of destiny.",
        "A rising tide carries both hope and uncertainty.",
         "Dreams are the sanctuaries of endless possibility.",
        "Frost preserves the wisdom of the past.",
         "The crescent moon holds secrets seen by few.",
         "Day fifty invites a balance between the heart and the mind.",
        "Under the canopy of stars, the soul learns its measure.",
        "Glinaeus teaches the inevitability of renewal.",
        "The unspoken truths of night are gifts to the brave.",
        "Thalassiel’s ocean carries lessons of adaptability.",
        "The forests sing of cycles both new and old.",
        "The rivers of change are fed by courage’s streams.",
         "The harvest moon reflects the year’s quiet labor.",
        "Through Stygian waters flows the promise of rebirth.",
        "Celebrate Silenian’s gifts as the breath of life renewed.",
        "Order is the scaffold upon which creativity builds.",
        "Each note of harmony is a lesson from the infinite.",
        "The light of the Reformed Path shines brightest in twilight.",
         "Through the mist of doubt comes the clarity of purpose.",
         "The rhythms of nature are the echoes of eternity.",
         "On the edge of darkness lies the bloom of dawn.",
        "Day eighty reflects the strength found in adaptation.",
        "Cycles are the silent architects of existence.",
        "Dreams guide those who listen with open hearts.",
        "In the chill of Glinaeus lies the warmth of discovery.",
        "Celebrate the night as a canvas for unseen truths.",
        "Day ninety reveals the beauty in stillness.",
        "Nature’s melody is composed of change and stability.",
        "Silenian reminds us: joy is the soul’s compass.",
        "Catosien’s laurel crowns the disciplined and the brave.",
        "Each moment of order births infinite potential.",
         "Every day is a page in the ever-turning scroll of wisdom.",
        -- Continues up to day 183
     }
     }


     -- Retrieve today’s proverb
     local month, dayInMonth, zodiac
     local dailyProverb = proverbs[dayOfYear]
    if dayOfYear <= 61 then
        month = "Atosiel"
        dayInMonth = dayOfYear
        if dayInMonth <= 12 then zodiac = "Atosien"
        elseif dayInMonth <= 24 then zodiac = "Eosena"
        elseif dayInMonth <= 36 then zodiac = "Micrasha"
        elseif dayInMonth <= 48 then zodiac = "Pyreska"
        else zodiac = "Indomin" end
    elseif dayOfYear <= 122 then
        month = "Thalassiel"
        dayInMonth = dayOfYear - 61
        if dayInMonth <= 12 then zodiac = "Chrysen"
        elseif dayInMonth <= 24 then zodiac = "Thalassian"
        elseif dayInMonth <= 36 then zodiac = "Nephelia"
        elseif dayInMonth <= 48 then zodiac = "Glinaeus"
        else zodiac = "Noctien" end
     else
        month = "Opsitheiel"
        dayInMonth = dayOfYear - 122
        if dayInMonth <= 12 then zodiac = "Opsithia"
        elseif dayInMonth <= 24 then zodiac = "Stygian"
        elseif dayInMonth <= 36 then zodiac = "Faunian"
        elseif dayInMonth <= 48 then zodiac = "Silenian"
        else zodiac = "Catosien" end
    end


     -- Return the formatted result
     local events = {
     return dayOfYear .. ", PSSC Year: " .. psscYear .. " – Proverb: " .. dailyProverb
        ["Atosiel,6"] = "Bayram al-Nur (Festival of Light) [Vaeringheim]",
        ["Atosiel,18"] = "Chag Or Hadash (Festival of New Light) [Luminaria]",
        ["Atosiel,30"] = "Symposion Eirinis (Symposium of Harmony) [Serena]",
        ["Atosiel,43"] = "Alev Günü (Day of Flame) [Pyralis]",
        ["Atosiel,55"] = "Tikkun Tzel (Repair of Shadows) [Symphonara]",
        ["Thalassiel,67"] = "Panegyris Chrysou (Golden Gathering) [Aurelia]",
        ["Thalassiel,80"] = "Mehtap Dalgası (Moonlit Tide) [Vaeringheim]",
        ["Thalassiel,92"] = "Oneiro Foteino (Dream of Illumination) [Somniumpolis]",
        ["Thalassiel,105"] = "Erev Galgal (Eve of Cycles) [Nexa]",
        ["Thalassiel,115"] = "Leilat al-Kamar (Night of the Moon) [Lunalis Sancta]",
        ["Opsitheiel,128"] = "Chag Tvuah (Festival of Harvest) [Sylvapolis]",
        ["Opsitheiel,140"] = "Anagenesis Eirmos (Procession of Rebirth) [Acheron]",
        ["Opsitheiel,150"] = "Panagia Therizis (Holy Day of the Reaper) [Sylvapolis]",
        ["Opsitheiel,165"] = "Karnavali Thysias (Carnival of Celebration) [Erythros]",
        ["Opsitheiel,175"] = "Sefar Yashar (Straight Path Celebration) [Catonis Atrium]"
    }
 
    local eventKey = month .. "," .. dayInMonth
    local event = events[eventKey] or "No significant events today."
    local dailyProverb = zodiacProverbs[zodiac]
 
     return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
end
end


return p
return p

Revision as of 04:15, 12 December 2024

Documentation for this module may be created at Module:BassaridianCalendar/doc

local p = {}

function p.getCurrentDate()
    local startDate = os.time({year = 1999, month = 8, day = 6})
    local secondsInDay = 86400
    local daysPerYear = 183

    local currentDate = os.time()
    local totalDaysElapsed = math.floor((currentDate - startDate) / secondsInDay)

    local yearFraction = totalDaysElapsed / daysPerYear
    local psscYear = math.floor(yearFraction)
    local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1

    local zodiacProverbs = {
        Atosien = "The first light reveals the sacred cycle of renewal.",
        Eosena = "The dawn whispers: every step is a rebirth.",
        Micrasha = "Wisdom is the balance of shadow and flame.",
        Pyreska = "Creation ignites in the fires of transformation.",
        Indomin = "Two paths intertwine: strength in unity, clarity in duality.",
        Chrysen = "Gold is the soul's test: will you hoard or share?",
        Thalassian = "The tides of Thalassiel teach patience and purpose.",
        Nephelia = "Dreams are stars, fleeting yet eternal in the night sky.",
        Glinaeus = "The frost preserves what must endure.",
        Noctien = "Night guides those who seek the unseen truths.",
        Opsithia = "The harvest feeds not just the body, but the spirit.",
        Stygian = "Through the Styx flows the essence of transformation.",
        Faunian = "The forests sing of life and the balance it brings.",
        Silenian = "Celebration is the nectar of divine abundance.",
        Catosien = "Order shapes greatness; the straight path ascends."
    }

    local month, dayInMonth, zodiac
    if dayOfYear <= 61 then
        month = "Atosiel"
        dayInMonth = dayOfYear
        if dayInMonth <= 12 then zodiac = "Atosien"
        elseif dayInMonth <= 24 then zodiac = "Eosena"
        elseif dayInMonth <= 36 then zodiac = "Micrasha"
        elseif dayInMonth <= 48 then zodiac = "Pyreska"
        else zodiac = "Indomin" end
    elseif dayOfYear <= 122 then
        month = "Thalassiel"
        dayInMonth = dayOfYear - 61
        if dayInMonth <= 12 then zodiac = "Chrysen"
        elseif dayInMonth <= 24 then zodiac = "Thalassian"
        elseif dayInMonth <= 36 then zodiac = "Nephelia"
        elseif dayInMonth <= 48 then zodiac = "Glinaeus"
        else zodiac = "Noctien" end
    else
        month = "Opsitheiel"
        dayInMonth = dayOfYear - 122
        if dayInMonth <= 12 then zodiac = "Opsithia"
        elseif dayInMonth <= 24 then zodiac = "Stygian"
        elseif dayInMonth <= 36 then zodiac = "Faunian"
        elseif dayInMonth <= 48 then zodiac = "Silenian"
        else zodiac = "Catosien" end
    end

    local events = {
        ["Atosiel,6"] = "Bayram al-Nur (Festival of Light) [Vaeringheim]",
        ["Atosiel,18"] = "Chag Or Hadash (Festival of New Light) [Luminaria]",
        ["Atosiel,30"] = "Symposion Eirinis (Symposium of Harmony) [Serena]",
        ["Atosiel,43"] = "Alev Günü (Day of Flame) [Pyralis]",
        ["Atosiel,55"] = "Tikkun Tzel (Repair of Shadows) [Symphonara]",
        ["Thalassiel,67"] = "Panegyris Chrysou (Golden Gathering) [Aurelia]",
        ["Thalassiel,80"] = "Mehtap Dalgası (Moonlit Tide) [Vaeringheim]",
        ["Thalassiel,92"] = "Oneiro Foteino (Dream of Illumination) [Somniumpolis]",
        ["Thalassiel,105"] = "Erev Galgal (Eve of Cycles) [Nexa]",
        ["Thalassiel,115"] = "Leilat al-Kamar (Night of the Moon) [Lunalis Sancta]",
        ["Opsitheiel,128"] = "Chag Tvuah (Festival of Harvest) [Sylvapolis]",
        ["Opsitheiel,140"] = "Anagenesis Eirmos (Procession of Rebirth) [Acheron]",
        ["Opsitheiel,150"] = "Panagia Therizis (Holy Day of the Reaper) [Sylvapolis]",
        ["Opsitheiel,165"] = "Karnavali Thysias (Carnival of Celebration) [Erythros]",
        ["Opsitheiel,175"] = "Sefar Yashar (Straight Path Celebration) [Catonis Atrium]"
    }

    local eventKey = month .. "," .. dayInMonth
    local event = events[eventKey] or "No significant events today."
    local dailyProverb = zodiacProverbs[zodiac]

    return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
end

return p