BlueGit

blue-star tribegen

flip for consistency

timfa Tim Falken · pushed by timfa

Authored 2026-02-05 · 9 months ago

Hash
5aa479ef231a75d53f73097ccb717a6fa53e55f6
Parent
7e207d2d
1 file changed +4 −4
web/src/api/game.php +4 −4
@@ -676,8 +676,8 @@ if ($method === 'POST') {
676 676 $tribe = Tribe::load($userId, $saveId);
677 677
678 678 // Get kobolds with full stats, items and injuries
679 $kobolds = getKobolds($tribe, true);
680 $rivals = getKobolds($tribe, false);
679 $kobolds = getKobolds($tribe, false);
680 $rivals = getKobolds($tribe, true);
681 681
682 682 // Get storage items
683 683 $storage = $tribe->getStorage();
@@ -758,10 +758,10 @@ if ($method === 'POST') {
758 758 }
759 759 }
760 760
761 function getKobolds($tribe, $tribeMembers): array
761 function getKobolds($tribe, $getRivals): array
762 762 {
763 763 $kobolds = [];
764 foreach ($tribe->getKobolds(!$tribeMembers) as $kobold) {
764 foreach ($tribe->getKobolds($getRivals === true) as $kobold) {
765 765 $kInjuries = $kobold->getInjuries() ?? [];
766 766 // enrich injuries with required medicine mapping
767 767 foreach ($kInjuries as &$inj) {
@@ -676,8 +676,8 @@ if ($method === 'POST') {
676 $tribe = Tribe::load($userId, $saveId);
676 $tribe = Tribe::load($userId, $saveId);
677
677
678 // Get kobolds with full stats, items and injuries
678 // Get kobolds with full stats, items and injuries
679 $kobolds = getKobolds($tribe, true);
679 $kobolds = getKobolds($tribe, false);
680 $rivals = getKobolds($tribe, false);
680 $rivals = getKobolds($tribe, true);
681
681
682 // Get storage items
682 // Get storage items
683 $storage = $tribe->getStorage();
683 $storage = $tribe->getStorage();
@@ -758,10 +758,10 @@ if ($method === 'POST') {
758 }
758 }
759}
759}
760
760
761function getKobolds($tribe, $tribeMembers): array
761function getKobolds($tribe, $getRivals): array
762{
762{
763 $kobolds = [];
763 $kobolds = [];
764 foreach ($tribe->getKobolds(!$tribeMembers) as $kobold) {
764 foreach ($tribe->getKobolds($getRivals === true) as $kobold) {
765 $kInjuries = $kobold->getInjuries() ?? [];
765 $kInjuries = $kobold->getInjuries() ?? [];
766 // enrich injuries with required medicine mapping
766 // enrich injuries with required medicine mapping
767 foreach ($kInjuries as &$inj) {
767 foreach ($kInjuries as &$inj) {