Module:BassaridianCalendar: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
No edit summary
No edit summary
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 = 24 * 60 * 60
     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)
     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


    -- Determine month, day, zodiac
     local zodiacProverbs = {
    local month, dayInMonth, zodiac
         Atosien = "The first light reveals the sacred cycle of renewal.",
     local zodiacs = {
        Eosena = "The dawn whispers: every step is a rebirth.",
         Atosiel = {"Atosien", "Eosena", "Micrasha", "Pyreska", "Indomin"},
        Micrasha = "Wisdom is the balance of shadow and flame.",
         Thalassiel = {"Chrysen", "Thalassian", "Nephelia", "Glinaeus", "Noctien"},
        Pyreska = "Creation ignites in the fires of transformation.",
         Opsitheiel = {"Opsithia", "Stygian", "Faunian", "Silenian", "Catosien"}
        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
     if dayOfYear <= 61 then
         month = "Atosiel"
         month = "Atosiel"
         dayInMonth = dayOfYear
         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
     elseif dayOfYear <= 122 then
         month = "Thalassiel"
         month = "Thalassiel"
         dayInMonth = dayOfYear - 61
         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
     else
         month = "Opsitheiel"
         month = "Opsitheiel"
         dayInMonth = dayOfYear - 122
         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
     end


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


    -- Generate proverb and event
     local eventKey = month .. "," .. dayInMonth
     local eventKey = month .. "," .. dayInMonth
     local event = events[eventKey] or "No significant events today."
     local event = events[eventKey] or "No significant events today."
     local proverb = "Proverb of " .. zodiac .. ": Seek balance and purpose."
     local dailyProverb = zodiacProverbs[zodiac]


    -- Return formatted date
     return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
     return dayOfYear .. ", " .. month .. " ([[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|" .. zodiac .. "]]), " .. psscYear .. " PSSC – " .. event .. " – " .. proverb
end
end


return p
return p

Revision as of 03:32, 11 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