log
Browse files- index.html +1 -1
- src/lib/components/Pages/Encounters.svelte +4 -0
index.html
CHANGED
|
@@ -34,7 +34,7 @@
|
|
| 34 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
| 35 |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
| 36 |
|
| 37 |
-
<title>Piclets
|
| 38 |
|
| 39 |
<script>
|
| 40 |
// Register service worker
|
|
|
|
| 34 |
<meta name="apple-mobile-web-app-capable" content="yes">
|
| 35 |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
| 36 |
|
| 37 |
+
<title>Piclets</title>
|
| 38 |
|
| 39 |
<script>
|
| 40 |
// Register service worker
|
src/lib/components/Pages/Encounters.svelte
CHANGED
|
@@ -142,6 +142,7 @@
|
|
| 142 |
try {
|
| 143 |
// Get all piclet instances
|
| 144 |
const allPiclets = await db.picletInstances.toArray();
|
|
|
|
| 145 |
|
| 146 |
// Filter piclets that have a roster position (0-5)
|
| 147 |
const rosterPiclets = allPiclets.filter(p =>
|
|
@@ -150,12 +151,14 @@
|
|
| 150 |
p.rosterPosition >= 0 &&
|
| 151 |
p.rosterPosition <= 5
|
| 152 |
);
|
|
|
|
| 153 |
|
| 154 |
// Sort by roster position
|
| 155 |
rosterPiclets.sort((a, b) => (a.rosterPosition ?? 0) - (b.rosterPosition ?? 0));
|
| 156 |
|
| 157 |
// Get healthy piclets
|
| 158 |
const healthyPiclets = rosterPiclets.filter(p => p.currentHp > 0);
|
|
|
|
| 159 |
|
| 160 |
if (healthyPiclets.length === 0) {
|
| 161 |
alert('You need at least one healthy piclet in your roster to battle!');
|
|
@@ -164,6 +167,7 @@
|
|
| 164 |
|
| 165 |
// Check if there's at least one piclet in position 0
|
| 166 |
const hasPosition0 = rosterPiclets.some(p => p.rosterPosition === 0);
|
|
|
|
| 167 |
if (!hasPosition0) {
|
| 168 |
alert('You need a piclet in the first roster slot (position 0) to battle!');
|
| 169 |
return;
|
|
|
|
| 142 |
try {
|
| 143 |
// Get all piclet instances
|
| 144 |
const allPiclets = await db.picletInstances.toArray();
|
| 145 |
+
console.log('All piclets:', allPiclets);
|
| 146 |
|
| 147 |
// Filter piclets that have a roster position (0-5)
|
| 148 |
const rosterPiclets = allPiclets.filter(p =>
|
|
|
|
| 151 |
p.rosterPosition >= 0 &&
|
| 152 |
p.rosterPosition <= 5
|
| 153 |
);
|
| 154 |
+
console.log('Roster piclets:', rosterPiclets);
|
| 155 |
|
| 156 |
// Sort by roster position
|
| 157 |
rosterPiclets.sort((a, b) => (a.rosterPosition ?? 0) - (b.rosterPosition ?? 0));
|
| 158 |
|
| 159 |
// Get healthy piclets
|
| 160 |
const healthyPiclets = rosterPiclets.filter(p => p.currentHp > 0);
|
| 161 |
+
console.log('Healthy piclets:', healthyPiclets);
|
| 162 |
|
| 163 |
if (healthyPiclets.length === 0) {
|
| 164 |
alert('You need at least one healthy piclet in your roster to battle!');
|
|
|
|
| 167 |
|
| 168 |
// Check if there's at least one piclet in position 0
|
| 169 |
const hasPosition0 = rosterPiclets.some(p => p.rosterPosition === 0);
|
| 170 |
+
console.log('Has position 0:', hasPosition0);
|
| 171 |
if (!hasPosition0) {
|
| 172 |
alert('You need a piclet in the first roster slot (position 0) to battle!');
|
| 173 |
return;
|