BlueGit

blue-star tribegen

describe lost harvests

timfa Tim · pushed by timfa

Authored 2026-01-30 · 9 months ago

Hash
abf13f945b8d9f9851e509e0dc9917aa4acd22e7
Parent
9dea8e8a
1 file changed +56 −2
web/src/Classes/Tribe.php +56 −2
@@ -591,12 +591,66 @@ class Tribe
591 591
592 592 $monthOfYear = (($this->currentMonth - 1) % 12) + 1;
593 593 $index = intdiv($monthOfYear - 1, 3);
594 $pIndex = ($index + 3) % 4;
594 595
596 $previousSeason = $seasons[$pIndex];
595 597 $this->currentSeason = $seasons[$index];
596 // Random month events happen here (handled by EventManager in API)
597 // After events, consume food
598 598
599 if ($previousSeason == 'spring' && $this->currentSeason == 'summer') {
600 if (!isset($this->dataStore->wasSowedInSpring) || !$this->dataStore->wasSowedInSpring) {
601 $noHarvestVariations = [
602 "No seeds were sown in spring, so there can be no harvest come autumn.\n",
603 "With spring left untilled, there can be no harvest in autumn.\n",
604 "Spring passed without sowing; there can be no harvest this autumn.\n",
605 "The tribe never sowed in spring, so there can be no harvest later.\n",
606 "Nothing was planted in spring—there can be no harvest in autumn.\n",
607 "Spring's fields lay empty, and there can be no harvest ahead.\n",
608 "No planting happened in spring, so there can be no harvest when autumn arrives.\n"
609 ];
610 $foodStory = $noHarvestVariations[array_rand($noHarvestVariations)];
611 }
612 }
613
614 if (
615 isset($this->dataStore->wasSowedInSpring)
616 && $this->dataStore->wasSowedInSpring
617 && $previousSeason == 'summer'
618 && $this->currentSeason == 'autumn'
619 ) {
620 if (!isset($this->dataStore->wasTendedInSummer) || !$this->dataStore->wasTendedInSummer) { //this check is redundant but whatever
621 $cropLossVariations = [
622 "The fields were not tended in summer, and all of the crops are lost.\n",
623 "Neglected through summer, all of the crops are lost.\n",
624 "With no summer care, all of the crops are lost to blight and pests.\n",
625 "Summer passed without tending the fields, and all of the crops are lost.\n",
626 "The fields were left to wild growth; all of the crops are lost.\n",
627 "No hands worked the fields in summer, so all of the crops are lost.\n",
628 "Left untended through summer, all of the crops are lost.\n"
629 ];
630 $foodStory = $cropLossVariations[array_rand($cropLossVariations)];
631 }
632 }
633
634 if (
635 isset($this->dataStore->wasTendedInSummer) //this being true means no harvest happened
636 && $this->dataStore->wasTendedInSummer
637 && $previousSeason == 'summer'
638 && $this->currentSeason == 'autumn'
639 ) {
640 $cropLossVariations = [
641 "The crops stood too long, and winter's cold ruined what should have been gathered.\n",
642 "Harvest came too late; the first hard freezes destroyed the crops.\n",
643 "No harvest was taken in time, and the winter cold ruined the fields.\n",
644 "The fields were left unharvested, and winter's chill destroyed the crops.\n",
645 "The tribe missed the harvest window, and the cold of winter claimed the crops.\n",
646 "By the time harvest was attempted, winter had already destroyed the crops.\n",
647 "The crops were left in the fields until winter, and the cold destroyed them.\n"
648 ];
649 $foodStory = $cropLossVariations[array_rand($cropLossVariations)];
650 }
599 651
652 // Random month events happen here
653 // After events, consume food
600 654
601 655 // age eggs
602 656 $foodStory = "A month passes...\n" . $this->consumeFood();
@@ -591,12 +591,66 @@ class Tribe
591
591
592 $monthOfYear = (($this->currentMonth - 1) % 12) + 1;
592 $monthOfYear = (($this->currentMonth - 1) % 12) + 1;
593 $index = intdiv($monthOfYear - 1, 3);
593 $index = intdiv($monthOfYear - 1, 3);
594 $pIndex = ($index + 3) % 4;
594
595
596 $previousSeason = $seasons[$pIndex];
595 $this->currentSeason = $seasons[$index];
597 $this->currentSeason = $seasons[$index];
596 // Random month events happen here (handled by EventManager in API)
597 // After events, consume food
598
598
599 if ($previousSeason == 'spring' && $this->currentSeason == 'summer') {
600 if (!isset($this->dataStore->wasSowedInSpring) || !$this->dataStore->wasSowedInSpring) {
601 $noHarvestVariations = [
602 "No seeds were sown in spring, so there can be no harvest come autumn.\n",
603 "With spring left untilled, there can be no harvest in autumn.\n",
604 "Spring passed without sowing; there can be no harvest this autumn.\n",
605 "The tribe never sowed in spring, so there can be no harvest later.\n",
606 "Nothing was planted in spring—there can be no harvest in autumn.\n",
607 "Spring's fields lay empty, and there can be no harvest ahead.\n",
608 "No planting happened in spring, so there can be no harvest when autumn arrives.\n"
609 ];
610 $foodStory = $noHarvestVariations[array_rand($noHarvestVariations)];
611 }
612 }
613
614 if (
615 isset($this->dataStore->wasSowedInSpring)
616 && $this->dataStore->wasSowedInSpring
617 && $previousSeason == 'summer'
618 && $this->currentSeason == 'autumn'
619 ) {
620 if (!isset($this->dataStore->wasTendedInSummer) || !$this->dataStore->wasTendedInSummer) { //this check is redundant but whatever
621 $cropLossVariations = [
622 "The fields were not tended in summer, and all of the crops are lost.\n",
623 "Neglected through summer, all of the crops are lost.\n",
624 "With no summer care, all of the crops are lost to blight and pests.\n",
625 "Summer passed without tending the fields, and all of the crops are lost.\n",
626 "The fields were left to wild growth; all of the crops are lost.\n",
627 "No hands worked the fields in summer, so all of the crops are lost.\n",
628 "Left untended through summer, all of the crops are lost.\n"
629 ];
630 $foodStory = $cropLossVariations[array_rand($cropLossVariations)];
631 }
632 }
633
634 if (
635 isset($this->dataStore->wasTendedInSummer) //this being true means no harvest happened
636 && $this->dataStore->wasTendedInSummer
637 && $previousSeason == 'summer'
638 && $this->currentSeason == 'autumn'
639 ) {
640 $cropLossVariations = [
641 "The crops stood too long, and winter's cold ruined what should have been gathered.\n",
642 "Harvest came too late; the first hard freezes destroyed the crops.\n",
643 "No harvest was taken in time, and the winter cold ruined the fields.\n",
644 "The fields were left unharvested, and winter's chill destroyed the crops.\n",
645 "The tribe missed the harvest window, and the cold of winter claimed the crops.\n",
646 "By the time harvest was attempted, winter had already destroyed the crops.\n",
647 "The crops were left in the fields until winter, and the cold destroyed them.\n"
648 ];
649 $foodStory = $cropLossVariations[array_rand($cropLossVariations)];
650 }
599
651
652 // Random month events happen here
653 // After events, consume food
600
654
601 // age eggs
655 // age eggs
602 $foodStory = "A month passes...\n" . $this->consumeFood();
656 $foodStory = "A month passes...\n" . $this->consumeFood();