Module:BassaridianCalendar: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 62: Line 62:
     end
     end


     -- Proverb lists for each zodiac
     -- Proverb lists for each zodiac (shortened for clarity)
     local proverbs = {
     local proverbs = {
         Atosien = {
         Atosien = {"The light of truth burns brightest in darkness."},
            "The light of truth burns brightest in darkness.",
         Eosena = {"Every dawn brings new beginnings."},
            "Seek clarity, and you will find purpose.",
         Micrasha = {"Balance guides us to harmony."},
            "Light is the pathfinder to wisdom.",
         -- Add other zodiacs here
            "The sun rises, igniting the soul."
        },
         Eosena = {
            "Every dawn brings new beginnings.",
            "Hope rises with the sun.",
            "Embrace renewal with every sunrise.",
            "Dawn whispers the secrets of tomorrow."
        },
        -- Similar proverb lists for each zodiac
         Micrasha = {"Balance guides us to harmony.", "Justice shines in the balanced mind."},
         Pyreska = {"Creativity burns like fire.", "Passion is a flame within us."},
        Indomin = {"Strength is in adaptability.", "Duality balances existence."},
        Chrysen = {"Ambition shapes the world.", "Wealth fuels the courageous."},
        Thalassian = {"The tides carry wisdom.", "The ocean whispers mysteries."},
        Nephelia = {"Dreams sculpt reality.", "Imagination bridges the infinite."},
        Glinaeus = {"Cycles renew life.", "Time heals and restores."},
        Noctien = {"In darkness lies discovery.", "Shadows reveal the hidden."},
        Opsithia = {"Abundance springs from the soil.", "Harvest is the earth's gift."},
        Stygian = {"Transformation is life's truth.", "Rebirth comes with courage."},
        Faunian = {"Nature nurtures the soul.", "Harmony grows in balance."},
        Silenian = {"Revelry renews the spirit.", "Celebration is life's pulse."},
        Catosien = {"Order shapes greatness.", "Discipline builds legacies."}
     }
     }


     -- Proverb rotation
     -- Proverb rotation
     local zodiacProverbs = proverbs[zodiac]
     local zodiacProverbs = proverbs[zodiac] or {"No proverb available for today."}
     local daySeed = ((totalDaysElapsed - 1) % #zodiacProverbs) + 1
     local daySeed = ((totalDaysElapsed - 1) % #zodiacProverbs) + 1
     local dailyProverb = zodiacProverbs[daySeed]
     local dailyProverb = zodiacProverbs[daySeed]


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


Line 120: Line 98:
     local event = events[eventKey] or "No significant events today."
     local event = events[eventKey] or "No significant events today."


     -- Return the formatted date with a daily proverb
     -- Return the formatted date with a daily proverb and linked event
     return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
     return dayOfYear .. ", " .. month .. " (" .. "[https://micras.org/mwiki/Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac " .. zodiac .. "]" .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
end
end


return p
return p

Revision as of 03:21, 11 December 2024

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

local p = {}

function p.getCurrentDate()
    -- Constants
    local startDate = os.time({year = 1999, month = 8, day = 6}) -- August 6, 1999
    local secondsInDay = 24 * 60 * 60 -- Number of seconds in a day
    local daysPerYear = 183

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

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

    -- Determine month, day within the month, and zodiac
    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

    -- Proverb lists for each zodiac (shortened for clarity)
    local proverbs = {
        Atosien = {"The light of truth burns brightest in darkness."},
        Eosena = {"Every dawn brings new beginnings."},
        Micrasha = {"Balance guides us to harmony."},
        -- Add other zodiacs here
    }

    -- Proverb rotation
    local zodiacProverbs = proverbs[zodiac] or {"No proverb available for today."}
    local daySeed = ((totalDaysElapsed - 1) % #zodiacProverbs) + 1
    local dailyProverb = zodiacProverbs[daySeed]

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

    -- Find the event for the current day
    local eventKey = month .. "," .. dayInMonth
    local event = events[eventKey] or "No significant events today."

    -- Return the formatted date with a daily proverb and linked event
    return dayOfYear .. ", " .. month .. " (" .. "[https://micras.org/mwiki/Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac " .. zodiac .. "]" .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
end

return p