Module:BassaridianCalendar: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
NewZimiaGov (talk | contribs)
No edit summary
NewZimiaGov (talk | contribs)
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 13: Line 13:
     local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1
     local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1


     -- Define zodiac proverbs
     -- DEBUG/LOG: if you'd like to see the dayOfYear for troubleshooting
    -- mw.log("DEBUG: dayOfYear = " .. tostring(dayOfYear))
 
    ----------------------------------------------------------------------------
    -- 1) SAFETY CHECK: Ensure dayOfYear is between 1 and 183 (inclusive)
    ----------------------------------------------------------------------------
    if dayOfYear < 1 then
        -- Option A: Wrap around by adding daysPerYear until we're back in range
        dayOfYear = dayOfYear + daysPerYear
        while dayOfYear < 1 do
            dayOfYear = dayOfYear + daysPerYear
        end
 
        -- Option B (alternative) could be a modulo approach:
        -- dayOfYear = ((dayOfYear - 1) % daysPerYear) + 1
    elseif dayOfYear > daysPerYear then
        -- If for some reason it exceeds 183, wrap around or clamp
        dayOfYear = ((dayOfYear - 1) % daysPerYear) + 1
    end
 
    ----------------------------------------------------------------------------
    -- 2) ZODIAC PROVERBS
    ----------------------------------------------------------------------------
     local zodiacProverbs = {
     local zodiacProverbs = {
         Atosien = "The first light reveals the sacred cycle of renewal.",
         Atosien   = "The first light reveals the sacred cycle of renewal.",
         Eosena = "The dawn whispers: every step is a rebirth.",
         Eosena   = "The dawn whispers: every step is a rebirth.",
         Micrasha = "Wisdom is the balance of shadow and flame.",
         Micrasha = "Wisdom is the balance of shadow and flame.",
         Pyreska = "Creation ignites in the fires of transformation.",
         Pyreska   = "Creation ignites in the fires of transformation.",
         Indomin = "Two paths intertwine: strength in unity, clarity in duality.",
         Indomin   = "Two paths intertwine: strength in unity, clarity in duality.",
         Chrysen = "Gold is the soul's test: will you hoard or share?",
         Chrysen   = "Gold is the soul's test: will you hoard or share?",
         Thalassian = "The tides of Thalassiel teach patience and purpose.",
         Thalassian= "The tides of Thalassiel teach patience and purpose.",
         Nephelia = "Dreams are stars, fleeting yet eternal in the night sky.",
         Nephelia = "Dreams are stars, fleeting yet eternal in the night sky.",
         Glinaeus = "The frost preserves what must endure.",
         Glinaeus = "The frost preserves what must endure.",
         Noctien = "Night guides those who seek the unseen truths.",
         Noctien   = "Night guides those who seek the unseen truths.",
         Opsithia = "The harvest feeds not just the body, but the spirit.",
         Opsithia = "The harvest feeds not just the body, but the spirit.",
         Stygian = "Through the Styx flows the essence of transformation.",
         Stygian   = "Through the Styx flows the essence of transformation.",
         Faunian = "The forests sing of life and the balance it brings.",
         Faunian   = "The forests sing of life and the balance it brings.",
         Silenian = "Celebration is the nectar of divine abundance.",
         Silenian = "Celebration is the nectar of divine abundance.",
         Catosien = "Order shapes greatness; the straight path ascends."
         Catosien = "Order shapes greatness; the straight path ascends."
     }
     }


     ------------------------------------------------------------------------
     ----------------------------------------------------------------------------
     -- Below is a table of events with short descriptions referencing lore --
     -- 3) DETERMINE MONTH, DAY-IN-MONTH, AND ZODIAC
     ------------------------------------------------------------------------
     ----------------------------------------------------------------------------
     local events = {
     local month, dayInMonth, zodiac
         -- Month: Atosiel
 
         ["Atosiel,6"] = [[Bayram al-Nur (Festival of Light) [Vaeringheim]
    -- Day ranges: 1..61 => Atosiel, 62..122 => Thalassiel, 123..183 => Opsitheiel
            - Originating in Vaeringheim, the oldest city in Bassaridia Vaeringheim, this festival honors Atos, Divine of Light and Creation. Locals gather near the famed Lake Morovia canals to celebrate the rebirth of the sun, embracing the city’s blend of Stripping Path and Alperkin traditions.]],
    if dayOfYear <= 61 then
        ["Atosiel,18"] = [[Chag Or Hadash (Festival of New Light) [Luminaria]
        month = "Atosiel"
            - Observed in Luminaria, where the Order of Aurora Mystica holds sway, this festival extols Eos, Lady Divine of dawn. Believers practice morning rites on the Plains of Vaeringheim, lighting lanterns symbolizing new beginnings and enlightenment.]],
        dayInMonth = dayOfYear
        ["Atosiel,30"] = [[Symposion Eirinis (Symposium of Harmony) [Serena]
 
            - Held in Serena’s Harmony Sanctum, devoted to Micras, Lady Divine of balance and wisdom. Citizens and priestesses engage in peaceful debates on the ruins of the ancient Normarkian military outpost, reflecting Serena’s journey from conflict to serenity.]],
        -- ZODIAC
        ["Atosiel,43"] = [[Alev Günü (Day of Flame) [Pyralis]
        if dayInMonth <= 12 then
            - Celebrated in Pyralis, the spiritual haven of Ignis Aeternum, which venerates Pyros, Divine of fire. Worshippers gather around the city’s geothermal hot springs, welcoming the spark of creativity and paying homage to the Highland Port marketplace.]],
            zodiac = "Atosien"
        ["Atosiel,48"] = [[Day of Abandonment [Vaeringheim]
        elseif dayInMonth <= 24 then
            - A solemn remembrance in the capital city, marking the exile of Vaeringheim’s early inhabitants by the Old Gods. Locals visit shrines of Thalassa, reciting prayers for redemption and introspection, echoing the Reformed Stripping Path’s journey from chaos to renewed order.]],
            zodiac = "Eosena"
        ["Atosiel,55"] = [[Tikkun Tzel (Repair of Shadows) [Symphonara]
        elseif dayInMonth <= 36 then
            - A reflective ceremony in Symphonara, home of the Celestial Harmony Sect (devoted to Indigo and Momiji). Rituals focus on healing discord between warring cults. Participants invoke the city’s famed Harmony Gardens to unify shadow and light through music and discourse.]],
            zodiac = "Micrasha"
        elseif dayInMonth <= 48 then
            zodiac = "Pyreska"
        else
            zodiac = "Indomin"
        end
 
    elseif dayOfYear <= 122 then
        month = "Thalassiel"
        dayInMonth = dayOfYear - 61
 
        -- ZODIAC
        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
 
        -- ZODIAC
        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
 
    ----------------------------------------------------------------------------
    -- 4) SAFETY NET: If somehow dayInMonth is still nil, handle gracefully
    ----------------------------------------------------------------------------
    if not dayInMonth then
        -- Provide a fallback, e.g., default to day 1 in Atosiel
         dayInMonth = 1
        month = "Atosiel"
        zodiac = "Atosien"
    end
 
    ----------------------------------------------------------------------------
    -- 5) DEFINE EVENTS WITH CORRECTED DAY ALIGNMENT AND SHORT DESCRIPTIONS
    ----------------------------------------------------------------------------
local events = {
    ["Atosiel,1"] = "Cricket Rise Festival [[Alperkin]] – Defining the winter-to-spring shift, this festival commemorates the crickets’ re-emergence from dormancy. Celebrated during the first full moon following their initial nocturnal song, some regions extend festivities until the whip-poor-will’s call.",
    ["Atosiel,6"] = "Bayram al-Nur (Festival of Light) [Vaeringheim] – Honors Atos’s creative power with candlelit processions, tales of divine origins, and symbolic lantern releases at dusk.",
    ["Atosiel,18"] = "Chag Or Hadash (Festival of New Light) [Luminaria] – Dawn prayers, luminous lanterns, and sunrise ceremonies dedicated to the Lady Divine Eos.",
    ["Atosiel,30"] = "Symposion Eirinis (Symposium of Harmony) [Serena] – Gatherings to share Micrasha’s wisdom through poetry, debates, and a communal harmony feast.",
    ["Atosiel,34"] = "Crösakarion [Luminaria] – Street dances and mask parades celebrating Host Star Crösacío, revered as a guiding light for travelers.",
    ["Atosiel,36"] = "Liléigostros [Somniumpolis] – Banquets by starlight to honor Host Star Liléigos, with shared dreams and prophetic storytelling.",
    ["Atosiel,43"] = "Alev Günü (Day of Flame) [Pyralis] – Ritual bonfires, fire-dancer troupes, and chanting of “Ignis Aeternum” in homage to Pyros.",
    ["Atosiel,44"] = "Orebellion [Thermosalem] – Vibrant street markets and fire-breathing displays celebrating Host Star Orebele’s energetic spirit.",
    ["Atosiel,48"] = "Day of Abandonment [Vaeringheim] – Somber vigils and dimly lit marches recalling the exile of mortals by the Old Gods.",
    ["Atosiel,54"] = "Sanashalros [Keybir-Aviv] – Mystical rites at midnight to honor Sanashalo’s zenith, often including rhythmic drums and trance dances.",
    ["Atosiel,55"] = "Tikkun Tzel (Repair of Shadows) [Symphonara] – Healing ceremonies to reconcile Indigo and Momiji’s followers, culminating in a unifying communal supper.",
    ["Atosiel,58"] = "Gahtarion [Vaeringheim] – Illuminated boat parades along canals, celebrating Host Star Gaht and blessing local waters.",
    ["Atosiel,59"] = "Agavronos [Aurelia] – Tree-planting ceremonies for Host Star Agave, where ribbons bearing hopes are tied to young saplings.",
    ["Atosiel,61"] = "Bebekarion [Akróstadium] – Communal meals in honor of Host Star Bebeakaus, each feast opening with a unifying toast.",
    ["Thalassiel,1"] = "Cicada Song Festival [[Alperkin]] – Occurring near the summer solstice, it begins after the season’s first cicada chorus. Alperkin’s most raucous festival, marking annual tribal migrations with drums, dancing, and open-air feasts.",
    ["Thalassiel,2"] = "Amaäzakar [Delphica] – A glowing lantern festival dedicated to Host Star Amaäz, believed to ward off misfortune with floating lights on rivers and ponds.",
    ["Thalassiel,6"] = "Panegyris Chrysou (Golden Gathering) [Aurelia] – A bustling trade fair under Chrysos’s blessing, featuring fortune-telling and gold-themed decorations.",
    ["Thalassiel,10"] = "Dilëtazorium [Sufriya] – Reflective day honoring Host Star Dilëtaz with quiet charity, abstaining from loud festivities.",
    ["Thalassiel,11"] = "Agrypnía Kyrenaïou [Erythros] – a fellowship dedicated to the veneration of Kyrenaïs, a mortal figure celebrated as favored among the gods, called by the Thiasos Kyrenaïou in the event of civil unrest in Erythros. Characterized by lively, wine-fueled public debates, plays, and competitions meant to foster unity among the city's population",
    ["Thalassiel,16"] = "Amazärum [Acheron] – Torchlit dances and shadow plays dramatizing the renewing power of Host Star Amazä.",
    ["Thalassiel,17"] = "Tävrosion [Thermosalem] – Contemplative meditations for Host Star Tä, often centered on sacred texts and soft chanting.",
    ["Thalassiel,18"] = "Bulhanum [Luminaria] – Ancestral rites for Host Star Bulhanu, where oral histories and offerings strengthen familial bonds.",
    ["Thalassiel,19"] = "Mehtap Dalgası (Moonlit Tide) [Vaeringheim] – Nighttime beach rituals invoking Thalassa’s lunar energy through chanted blessings and tidal sculptures.",
    ["Thalassiel,30"] = "Amáenarion [Vaeringheim] – Storytelling gatherings around bonfires, extolling the legends of Host Stars Amáenu and Pythe.",
    ["Thalassiel,31"] = "Oneiro Foteino (Dream of Illumination) [Somniumpolis] – Nephele’s dream festival, featuring guided dream-interpretation and surreal art displays.",
    ["Thalassiel,39"] = "Anniversary of victory in the New South Jangsong Campaign [Nexa] – Military parades and victory feasts celebrating the nation’s past heroes.",
    ["Thalassiel,44"] = "Erev Galgal (Eve of Cycles) [Nexa] – Glinos cycle rites with rotating chants, circle dances, and patterned floor art symbolizing renewal.",
    ["Thalassiel,45"] = "Bassaridia Festival [Somniumpolis] – A vibrant salute to Alperkin roots, featuring folk dances, drums, and ancestral legend reenactments.",
    ["Thalassiel,46"] = "Osirionos [Diamandis] – A spirited festival venerating Host Star Osiríos, concluding with pyrotechnics amid flower-draped streets.",
    ["Thalassiel,48"] = "Anniversary of victory in the Southern Lake Morovia Campaign [Somniumpolis] – Ceremonial marches, speeches, and wreaths honoring strategic triumphs.",
    ["Thalassiel,50"] = "Amaprion [Serena] – Citywide processions for Host Star Amap, adorned with floral wreaths and uplifting hymns.",
    ["Thalassiel,52"] = "Atämiorium [Catonis Atrium] – Ascension rites glorifying Host Star Atämios’s wisdom, completed by the release of floating lanterns.",
    ["Thalassiel,54"] = "Leilat al-Kamar (Night of the Moon) [Lunalis Sancta] – A moonlit vigil devoted to Noctis, marked by silent gatherings and midnight prayer.",
    ["Thalassiel,56"] = "Dranamorium [Lykopolis] – A contemplative day for Host Star Dranamos, including journaling, spiritual reading, and communal silence.",
    ["Thalassiel,58"] = "Aprobellium [Thermosalem] – Streets aglow with red lanterns honoring Host Star Aprobelle, featuring acrobats and spicy festival drinks.",
    ["Thalassiel,59"] = "Azorion [Pyralis] – A high-energy carnival lauding Host Star Azos’s fiery strength, with costumed parades and a midnight fireworks display.",
    ["Thalassiel,60"] = "Ocanarion [Tel-Amin] – Water-purification ceremonies for Host Star Ocananus, culminating in floating candles on rivers and lakes.",
    ["Thalassiel,61"] = "Taşrakah (Reverence of the Stone) [Luminaria] – Devotions to Eos and Tarsica, including stone-carving rites and anointing with fragrant oils.",
    ["Opsitheiel,1"] = "Cricket Fall Festival [[Alperkin]] – First full moon after crickets’ final song, a dark celebration honoring the dead and the Harpy Goddess of the Whip-Poor-Will. Some rituals involve necromancy, gambling, and taboo feasts as the Noctic-Rabred plant reaches peak toxicity.",
    ["Opsitheiel,6"] = "Chag Tvuah (Festival of Harvest) [Sylvapolis] – Joyous festivities praising Opsithe’s bounty with communal feasts, harvest dances, and bonfire-lit storytelling.",
    ["Opsitheiel,7"] = "Nyarion [Delphica] – Guided meditations and midnight music for Host Star Nyama, with scribes recording personal visions onto communal scrolls.",
    ["Opsitheiel,13"] = "Danassion [Diamandis] – Cemetery-side vigils and modest feasts to honor Host Star Danaß, bridging the living and the departed.",
    ["Opsitheiel,18"] = "Anagenesis Eirmos (Procession of Rebirth) [Acheron] – Dramatic Styx-themed parades symbolizing transformation, crossing bridges to echo mythic underworld journeys.",
    ["Opsitheiel,23"] = "Hazamorium [Sufriya] – Devotees ascend hills to watch the stars under Host Star Hazaméos, interpreting cloud movements as portents of fate.",
    ["Opsitheiel,28"] = "Panagia Therizis (Holy Day of the Reaper) [Sylvapolis] – Dual homage to Faun and Opsithe with seed-scattering and scythe dances that affirm life’s cyclical nature.",
    ["Opsitheiel,30"] = "The Silence [[Alperkin]] – A mid-winter festival coinciding with the solstice, observed through hushed reflections, minimal light, and introspective drumbeats—an austere contrast to the lively Cicada Song Festival.",
    ["Opsitheiel,35"] = "Häparion [[Vaeringheim]] – An art-centric celebration of Host Star Häpi, featuring live sculpting, painting contests, and open-air exhibitions.",
    ["Opsitheiel,37"] = "Anniversary of victory in the Morovian Frontier Campaign [Acheron] – Honored with night marches, wreath-laying, and recitations of epic battle poetry.",
    ["Opsitheiel,43"] = "Karnavali Thysias (Carnival of Celebration) [Erythros] – Wine-fueled revelries paying tribute to Silenus, with vivid satyr-like costumes, flutes, and dance. Karnavali Thysias also celebrates the role of the Host Spirit in Bassaridian society, the introduction of Dionysus to Micras by the Host Spirit, and the establishment of the Stripping Path in the 34th Era PSSC.",
    ["Opsitheiel,53"] = "Sefar Yashar (Straight Path Celebration) [Catonis Atrium] – Pilgrims walk a symbolic Path of Virtue and attend sermons on moral clarity in Cato’s name."
}


        -- Month: Thalassiel
        ["Thalassiel,6"] = [[Panegyris Chrysou (Golden Gathering) [Aurelia]
            - Aurelia, a former Morovian Nationalist stronghold, now prospers under Chrysos, Divine of wealth. Merchants and travelers converge here to trade rare gems and pay homage to the Guild of Golden Shadows, reflecting on the city’s gold-infused past.]],
        ["Thalassiel,17"] = [[Constitution Day [Luminaria]
            - Commemorates the signing of the first civic charter in Luminaria’s underground halls. Marked by processions led by the Conclave Illuminara, adherents of Tarsica, Lady Divine of illumination, symbolizing unity between Alperkin and Bassaridian peoples.]],
        ["Thalassiel,19"] = [[Mehtap Dalgası (Moonlit Tide) [Vaeringheim]
            - Vaeringheim’s Reformed Stripping Path priestesses guide night processions along Lake Morovia, celebrating Thalassa’s lunar mysteries. Worshipers honor the city’s maritime heritage with candlelit canal ceremonies that link sky, water, and tradition.]],
        ["Thalassiel,31"] = [[Oneiro Foteino (Dream of Illumination) [Somniumpolis]
            - Centered in Somniumpolis’s Reverie Nebulous, devoted to Nephele, Lady Divine of clouds and inspiration. Visions and dream-dances fill the Odiferae Wetlands, reflecting the city’s legendary bonds with pirates and mystics who navigate Morovia’s hidden currents.]],
        ["Thalassiel,39"] = [[Anniversary of victory in the New South Jangsong Campaign [Nexa]
            - Nexa’s Eon Fellowship, followers of Glinos, Divine of ice and life cycles, commemorate the annexation of New South Jangsong. Pilgrims circle the Bloodbaths of Laprind, recalling the campaign’s harsh winters and the city’s transformation from hidden refuge to strategic bastion.]],
        ["Thalassiel,44"] = [[Erev Galgal (Eve of Cycles) [Nexa]
            - Another Nexan observance dedicated to the cycle of life and death. Devotees of Glinos spend the evening chanting among the Gloom Forest’s crimson foliage, inviting renewal and reflecting on the city’s ancient Alperkin legends of cyclical rebirth.]],
        ["Thalassiel,45"] = [[Bassaridia Festival [Somniumpolis]
            - A grand festival celebrating the Alperkin roots of Somniumpolis and the expansion of Reformed Stripping Path values around Lake Morovia. Revelers exchange goods imbued with Noctic-Rabrev, fueling the city’s pirate-friendly reputation and artistic flair.]],
        ["Thalassiel,48"] = [[Anniversary of victory in the Southern Lake Morovia Campaign [Somniumpolis]
            - Marks the city’s successful stand against anti-Bassarid insurgencies, culminating in a turning point for the Reformed Stripping Path’s hold over the Odiferae Wetlands. Historic canals become filled with floating lanterns, honoring those lost in the campaign.]],
        ["Thalassiel,54"] = [[Leilat al-Kamar (Night of the Moon) [Lunalis Sancta]
            - Celebrated by the Order of the Umbral Oracle, devoted to Noctis, Lady Divine of the night. Pilgrims journey through Lunalis Sancta’s moonlit hills, reading from sacred tomes kept in the city’s labyrinthine libraries to glean hidden truths from the shadows.]],
        ["Thalassiel,61"] = [[Taşrakah (Reverence of the Stone) [Luminaria]
            - Conducted by the Conclave Illuminara and the Order of Aurora Mystica. The day highlights Luminaria’s famed subterranean temples, reaffirming Eos’s light in every carved tunnel. Families inscribe prayers onto stone tablets, symbolizing resilience and faith.]],


        -- Month: Opsitheiel
        ["Opsitheiel,6"] = [[Chag Tvuah (Festival of Harvest) [Sylvapolis]
            - Held in the rainy Odiferae Wetlands, where Opsithe, Lady Divine of harvest, is venerated. Locals and visiting pilgrims unite for seed-blessing rituals in Sylvapolis’s lush farmland, celebrating the city’s link to Alperkin myths of the “Emptiness” below.]],
        ["Opsitheiel,18"] = [[Anagenesis Eirmos (Procession of Rebirth) [Acheron]
            - A pilgrimage in Acheron’s Canyonlands to venerate Styx, Lady Divine of transformation and rebirth. Participants soak their feet in sacred pools, symbolizing the passage from mortal constraint to spiritual renewal as they near the Tomb of Styx.]],
        ["Opsitheiel,28"] = [[Panagia Therizis (Holy Day of the Reaper) [Sylvapolis]
            - Another Sylvapolis festival celebrating Opsithe and Faun, Lady Divine of natural balance. Farmers honor the end of the harvest season with communal feasts, reaffirming the city’s historical role as the “pathway” to the Alperkin Underworld.]],
        ["Opsitheiel,37"] = [[Anniversary of victory in the Morovian Frontier Campaign [Acheron]
            - Commemorates Acheron’s strategic triumph in securing trade routes near the Gloom Forest of Perpetual Autumn. The Mystery of the Stygian Veil hosts solemn rites in the canyonlands, bridging past battles and the city’s ethos of transformation.]],
        ["Opsitheiel,43"] = [[Karnavali Thysias (Carnival of Celebration) [Erythros]
            - Erythros’s Mystery of Red Mirth, devoted to Silenus, Divine of merriment, transforms the sacred Tar-Lands into a stage for music and dance. Statues of the Archigós—the golden Adlet—are honored, weaving Alperkin funeral rites with Bassarid revelry.]],
        ["Opsitheiel,53"] = [[Sefar Yashar (Straight Path Celebration) [Catonis Atrium]
            - In Catonis Atrium, home of Rex Catonis, worshipers of Cato, Divine of discipline and order, gather for public recitations of civic codes. The festival promotes discipline and self-improvement, reflecting the city’s satyr-influenced legacy of law, apple groves, and vegetable lamb herds.]]
    }


     -- Check for today's event
     ----------------------------------------------------------------------------
    -- 6) EVENT LOOKUP
    ----------------------------------------------------------------------------
     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 dailyProverb = zodiacProverbs[zodiac]


     -- Return the date, event, and proverb
     ----------------------------------------------------------------------------
     return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
    -- 7) LOOK UP PROVERB
    ----------------------------------------------------------------------------
    local dailyProverb = zodiacProverbs[zodiac] or "No proverb found."
 
    ----------------------------------------------------------------------------
    -- 8) RETURN THE RESULT
    ----------------------------------------------------------------------------
     return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear
          .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
end
 
function p.getCurrentDateNoProverb()
    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
 
    if dayOfYear < 1 then
        dayOfYear = dayOfYear + daysPerYear
        while dayOfYear < 1 do
            dayOfYear = dayOfYear + daysPerYear
        end
    elseif dayOfYear > daysPerYear then
        dayOfYear = ((dayOfYear - 1) % daysPerYear) + 1
    end
 
    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
 
    return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC"
end
end


return p
return p

Latest revision as of 18:32, 1 June 2026

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

    -- DEBUG/LOG: if you'd like to see the dayOfYear for troubleshooting
    -- mw.log("DEBUG: dayOfYear = " .. tostring(dayOfYear))

    ----------------------------------------------------------------------------
    -- 1) SAFETY CHECK: Ensure dayOfYear is between 1 and 183 (inclusive)
    ----------------------------------------------------------------------------
    if dayOfYear < 1 then
        -- Option A: Wrap around by adding daysPerYear until we're back in range
        dayOfYear = dayOfYear + daysPerYear
        while dayOfYear < 1 do
            dayOfYear = dayOfYear + daysPerYear
        end

        -- Option B (alternative) could be a modulo approach:
        -- dayOfYear = ((dayOfYear - 1) % daysPerYear) + 1
    elseif dayOfYear > daysPerYear then
        -- If for some reason it exceeds 183, wrap around or clamp
        dayOfYear = ((dayOfYear - 1) % daysPerYear) + 1
    end

    ----------------------------------------------------------------------------
    -- 2) ZODIAC PROVERBS
    ----------------------------------------------------------------------------
    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."
    }

    ----------------------------------------------------------------------------
    -- 3) DETERMINE MONTH, DAY-IN-MONTH, AND ZODIAC
    ----------------------------------------------------------------------------
    local month, dayInMonth, zodiac

    -- Day ranges: 1..61 => Atosiel, 62..122 => Thalassiel, 123..183 => Opsitheiel
    if dayOfYear <= 61 then
        month = "Atosiel"
        dayInMonth = dayOfYear

        -- ZODIAC
        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

        -- ZODIAC
        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

        -- ZODIAC
        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

    ----------------------------------------------------------------------------
    -- 4) SAFETY NET: If somehow dayInMonth is still nil, handle gracefully
    ----------------------------------------------------------------------------
    if not dayInMonth then
        -- Provide a fallback, e.g., default to day 1 in Atosiel
        dayInMonth = 1
        month = "Atosiel"
        zodiac = "Atosien"
    end

    ----------------------------------------------------------------------------
    -- 5) DEFINE EVENTS WITH CORRECTED DAY ALIGNMENT AND SHORT DESCRIPTIONS
    ----------------------------------------------------------------------------
local events = {
    ["Atosiel,1"] = "Cricket Rise Festival [[Alperkin]] – Defining the winter-to-spring shift, this festival commemorates the crickets’ re-emergence from dormancy. Celebrated during the first full moon following their initial nocturnal song, some regions extend festivities until the whip-poor-will’s call.",
    ["Atosiel,6"] = "Bayram al-Nur (Festival of Light) [Vaeringheim] – Honors Atos’s creative power with candlelit processions, tales of divine origins, and symbolic lantern releases at dusk.",
    ["Atosiel,18"] = "Chag Or Hadash (Festival of New Light) [Luminaria] – Dawn prayers, luminous lanterns, and sunrise ceremonies dedicated to the Lady Divine Eos.",
    ["Atosiel,30"] = "Symposion Eirinis (Symposium of Harmony) [Serena] – Gatherings to share Micrasha’s wisdom through poetry, debates, and a communal harmony feast.",
    ["Atosiel,34"] = "Crösakarion [Luminaria] – Street dances and mask parades celebrating Host Star Crösacío, revered as a guiding light for travelers.",
    ["Atosiel,36"] = "Liléigostros [Somniumpolis] – Banquets by starlight to honor Host Star Liléigos, with shared dreams and prophetic storytelling.",
    ["Atosiel,43"] = "Alev Günü (Day of Flame) [Pyralis] – Ritual bonfires, fire-dancer troupes, and chanting of “Ignis Aeternum” in homage to Pyros.",
    ["Atosiel,44"] = "Orebellion [Thermosalem] – Vibrant street markets and fire-breathing displays celebrating Host Star Orebele’s energetic spirit.",
    ["Atosiel,48"] = "Day of Abandonment [Vaeringheim] – Somber vigils and dimly lit marches recalling the exile of mortals by the Old Gods.",
    ["Atosiel,54"] = "Sanashalros [Keybir-Aviv] – Mystical rites at midnight to honor Sanashalo’s zenith, often including rhythmic drums and trance dances.",
    ["Atosiel,55"] = "Tikkun Tzel (Repair of Shadows) [Symphonara] – Healing ceremonies to reconcile Indigo and Momiji’s followers, culminating in a unifying communal supper.",
    ["Atosiel,58"] = "Gahtarion [Vaeringheim] – Illuminated boat parades along canals, celebrating Host Star Gaht and blessing local waters.",
    ["Atosiel,59"] = "Agavronos [Aurelia] – Tree-planting ceremonies for Host Star Agave, where ribbons bearing hopes are tied to young saplings.",
    ["Atosiel,61"] = "Bebekarion [Akróstadium] – Communal meals in honor of Host Star Bebeakaus, each feast opening with a unifying toast.",
    ["Thalassiel,1"] = "Cicada Song Festival [[Alperkin]] – Occurring near the summer solstice, it begins after the season’s first cicada chorus. Alperkin’s most raucous festival, marking annual tribal migrations with drums, dancing, and open-air feasts.",
    ["Thalassiel,2"] = "Amaäzakar [Delphica] – A glowing lantern festival dedicated to Host Star Amaäz, believed to ward off misfortune with floating lights on rivers and ponds.",
    ["Thalassiel,6"] = "Panegyris Chrysou (Golden Gathering) [Aurelia] – A bustling trade fair under Chrysos’s blessing, featuring fortune-telling and gold-themed decorations.",
    ["Thalassiel,10"] = "Dilëtazorium [Sufriya] – Reflective day honoring Host Star Dilëtaz with quiet charity, abstaining from loud festivities.",
    ["Thalassiel,11"] = "Agrypnía Kyrenaïou [Erythros] – a fellowship dedicated to the veneration of Kyrenaïs, a mortal figure celebrated as favored among the gods, called by the Thiasos Kyrenaïou in the event of civil unrest in Erythros.  Characterized by lively, wine-fueled public debates, plays, and competitions meant to foster unity among the city's population",
    ["Thalassiel,16"] = "Amazärum [Acheron] – Torchlit dances and shadow plays dramatizing the renewing power of Host Star Amazä.",
    ["Thalassiel,17"] = "Tävrosion [Thermosalem] – Contemplative meditations for Host Star Tä, often centered on sacred texts and soft chanting.",
    ["Thalassiel,18"] = "Bulhanum [Luminaria] – Ancestral rites for Host Star Bulhanu, where oral histories and offerings strengthen familial bonds.",
    ["Thalassiel,19"] = "Mehtap Dalgası (Moonlit Tide) [Vaeringheim] – Nighttime beach rituals invoking Thalassa’s lunar energy through chanted blessings and tidal sculptures.",
    ["Thalassiel,30"] = "Amáenarion [Vaeringheim] – Storytelling gatherings around bonfires, extolling the legends of Host Stars Amáenu and Pythe.",
    ["Thalassiel,31"] = "Oneiro Foteino (Dream of Illumination) [Somniumpolis] – Nephele’s dream festival, featuring guided dream-interpretation and surreal art displays.",
    ["Thalassiel,39"] = "Anniversary of victory in the New South Jangsong Campaign [Nexa] – Military parades and victory feasts celebrating the nation’s past heroes.",
    ["Thalassiel,44"] = "Erev Galgal (Eve of Cycles) [Nexa] – Glinos cycle rites with rotating chants, circle dances, and patterned floor art symbolizing renewal.",
    ["Thalassiel,45"] = "Bassaridia Festival [Somniumpolis] – A vibrant salute to Alperkin roots, featuring folk dances, drums, and ancestral legend reenactments.",
    ["Thalassiel,46"] = "Osirionos [Diamandis] – A spirited festival venerating Host Star Osiríos, concluding with pyrotechnics amid flower-draped streets.",
    ["Thalassiel,48"] = "Anniversary of victory in the Southern Lake Morovia Campaign [Somniumpolis] – Ceremonial marches, speeches, and wreaths honoring strategic triumphs.",
    ["Thalassiel,50"] = "Amaprion [Serena] – Citywide processions for Host Star Amap, adorned with floral wreaths and uplifting hymns.",
    ["Thalassiel,52"] = "Atämiorium [Catonis Atrium] – Ascension rites glorifying Host Star Atämios’s wisdom, completed by the release of floating lanterns.",
    ["Thalassiel,54"] = "Leilat al-Kamar (Night of the Moon) [Lunalis Sancta] – A moonlit vigil devoted to Noctis, marked by silent gatherings and midnight prayer.",
    ["Thalassiel,56"] = "Dranamorium [Lykopolis] – A contemplative day for Host Star Dranamos, including journaling, spiritual reading, and communal silence.",
    ["Thalassiel,58"] = "Aprobellium [Thermosalem] – Streets aglow with red lanterns honoring Host Star Aprobelle, featuring acrobats and spicy festival drinks.",
    ["Thalassiel,59"] = "Azorion [Pyralis] – A high-energy carnival lauding Host Star Azos’s fiery strength, with costumed parades and a midnight fireworks display.",
    ["Thalassiel,60"] = "Ocanarion [Tel-Amin] – Water-purification ceremonies for Host Star Ocananus, culminating in floating candles on rivers and lakes.",
    ["Thalassiel,61"] = "Taşrakah (Reverence of the Stone) [Luminaria] – Devotions to Eos and Tarsica, including stone-carving rites and anointing with fragrant oils.",
    ["Opsitheiel,1"] = "Cricket Fall Festival [[Alperkin]] – First full moon after crickets’ final song, a dark celebration honoring the dead and the Harpy Goddess of the Whip-Poor-Will. Some rituals involve necromancy, gambling, and taboo feasts as the Noctic-Rabred plant reaches peak toxicity.",
    ["Opsitheiel,6"] = "Chag Tvuah (Festival of Harvest) [Sylvapolis] – Joyous festivities praising Opsithe’s bounty with communal feasts, harvest dances, and bonfire-lit storytelling.",
    ["Opsitheiel,7"] = "Nyarion [Delphica] – Guided meditations and midnight music for Host Star Nyama, with scribes recording personal visions onto communal scrolls.",
    ["Opsitheiel,13"] = "Danassion [Diamandis] – Cemetery-side vigils and modest feasts to honor Host Star Danaß, bridging the living and the departed.",
    ["Opsitheiel,18"] = "Anagenesis Eirmos (Procession of Rebirth) [Acheron] – Dramatic Styx-themed parades symbolizing transformation, crossing bridges to echo mythic underworld journeys.",
    ["Opsitheiel,23"] = "Hazamorium [Sufriya] – Devotees ascend hills to watch the stars under Host Star Hazaméos, interpreting cloud movements as portents of fate.",
    ["Opsitheiel,28"] = "Panagia Therizis (Holy Day of the Reaper) [Sylvapolis] – Dual homage to Faun and Opsithe with seed-scattering and scythe dances that affirm life’s cyclical nature.",
    ["Opsitheiel,30"] = "The Silence [[Alperkin]] – A mid-winter festival coinciding with the solstice, observed through hushed reflections, minimal light, and introspective drumbeats—an austere contrast to the lively Cicada Song Festival.",
    ["Opsitheiel,35"] = "Häparion [[Vaeringheim]] – An art-centric celebration of Host Star Häpi, featuring live sculpting, painting contests, and open-air exhibitions.",
    ["Opsitheiel,37"] = "Anniversary of victory in the Morovian Frontier Campaign [Acheron] – Honored with night marches, wreath-laying, and recitations of epic battle poetry.",
    ["Opsitheiel,43"] = "Karnavali Thysias (Carnival of Celebration) [Erythros] – Wine-fueled revelries paying tribute to Silenus, with vivid satyr-like costumes, flutes, and dance. Karnavali Thysias also celebrates the role of the Host Spirit in Bassaridian society, the introduction of Dionysus to Micras by the Host Spirit, and the establishment of the Stripping Path in the 34th Era PSSC.",
    ["Opsitheiel,53"] = "Sefar Yashar (Straight Path Celebration) [Catonis Atrium] – Pilgrims walk a symbolic Path of Virtue and attend sermons on moral clarity in Cato’s name."
}



    ----------------------------------------------------------------------------
    -- 6) EVENT LOOKUP
    ----------------------------------------------------------------------------
    local eventKey = month .. "," .. dayInMonth
    local event = events[eventKey] or "No significant events today."

    ----------------------------------------------------------------------------
    -- 7) LOOK UP PROVERB
    ----------------------------------------------------------------------------
    local dailyProverb = zodiacProverbs[zodiac] or "No proverb found."

    ----------------------------------------------------------------------------
    -- 8) RETURN THE RESULT
    ----------------------------------------------------------------------------
    return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear
           .. " PSSC – " .. event .. " – Proverb: " .. dailyProverb
end

function p.getCurrentDateNoProverb()
    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

    if dayOfYear < 1 then
        dayOfYear = dayOfYear + daysPerYear
        while dayOfYear < 1 do
            dayOfYear = dayOfYear + daysPerYear
        end
    elseif dayOfYear > daysPerYear then
        dayOfYear = ((dayOfYear - 1) % daysPerYear) + 1
    end

    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

    return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. psscYear .. " PSSC"
end

return p