feat(expansion): implement Phase 3 (Town Restoration) and Phase 4 (Cannabis Textiles)

- Added TownSquareScene and linked it with M key transition
- Integrated TownRestorationSystem with material costs and inventory
- Added locked shop items in NPCShopSystem until buildings are restored
- Updated InteractionSystem to handle ruin restoration triggers
- Expanded Cannabis farming to yield Hemp Fiber
- Added Hemp Clothing crafting recipe and procedural icons
- Refactored StatusEffectSystem and NPCShopSystem to global classes
This commit is contained in:
2025-12-27 23:32:22 +01:00
parent 611cd35777
commit 822c586843
12 changed files with 454 additions and 40 deletions

View File

@@ -713,7 +713,11 @@ class TextureGenerator {
{ name: 'artefact_old', color: '#8B4513' }, // Ancient Pot (Brown)
{ name: 'milk', color: '#FFFFFF' }, // White
{ name: 'glowing_milk', color: '#00FF00' }, // Green
{ name: 'animal_feed', color: '#F4A460' } // Sandy Brown (Feed)
{ name: 'animal_feed', color: '#F4A460' }, // Sandy Brown (Feed)
{ name: 'cannabis', color: '#228B22' }, // Green
{ name: 'cannabis_seeds', color: '#55ff55' }, // Lighter Green
{ name: 'hemp_fiber', color: '#DEB887' }, // Tan/Beige
{ name: 'hemp_clothing', color: '#2E8B57' } // SeaGreen
];
items.forEach(item => {
const it = typeof item === 'string' ? item : item.name;
@@ -747,6 +751,17 @@ class TextureGenerator {
x.fillStyle = '#DAA520';
x.fillRect(13, 22, 6, 3);
}
else if (it === 'cannabis') {
// Cannabis Leaf (Stylized)
x.fillStyle = '#228B22';
// Center leaf
x.beginPath(); x.ellipse(16, 12, 3, 10, 0, 0, Math.PI * 2); x.fill();
// Side leaves
x.beginPath(); x.ellipse(10, 16, 3, 8, -Math.PI / 4, 0, Math.PI * 2); x.fill();
x.beginPath(); x.ellipse(22, 16, 3, 8, Math.PI / 4, 0, Math.PI * 2); x.fill();
x.beginPath(); x.ellipse(10, 24, 3, 6, -Math.PI / 2.5, 0, Math.PI * 2); x.fill();
x.beginPath(); x.ellipse(22, 24, 3, 6, Math.PI / 2.5, 0, Math.PI * 2); x.fill();
}
else if (it.includes('seeds')) {
// Seed Bag
x.fillStyle = '#DEB887'; // Burlywood bag
@@ -758,6 +773,42 @@ class TextureGenerator {
x.fillStyle = color;
x.beginPath(); x.arc(16, 18, 4, 0, Math.PI * 2); x.fill();
}
else if (it === 'cannabis_buds') {
// Stylized "bud" (forest green clusters)
x.fillStyle = '#228B22';
for (let i = 0; i < 5; i++) {
const ang = (i / 5) * Math.PI * 2;
x.beginPath();
x.arc(16 + Math.cos(ang) * 6, 16 + Math.sin(ang) * 6, 5, 0, Math.PI * 2);
x.fill();
}
x.fillStyle = '#8FBC8F'; // Frosted look
x.beginPath(); x.arc(16, 16, 4, 0, Math.PI * 2); x.fill();
}
else if (it === 'hemp_fiber') {
// Bundle of fibers (tan/straw color)
x.strokeStyle = '#DEB887';
x.lineWidth = 2;
for (let i = 0; i < 5; i++) {
x.beginPath();
x.moveTo(10 + i * 3, 24);
x.quadraticCurveTo(16, 16, 10 + (4 - i) * 3, 8);
x.stroke();
}
// Tie
x.fillStyle = '#8B4513';
x.fillRect(10, 15, 12, 2);
}
else if (it === 'hemp_clothing') {
// Simple T-shirt shape
x.fillStyle = '#2E8B57'; // SeaGreen
x.fillRect(8, 10, 16, 18); // Body
x.fillRect(4, 10, 6, 8); // Left sleeve
x.fillRect(22, 10, 6, 8); // Right sleeve
// Collar
x.fillStyle = '#000';
x.beginPath(); x.arc(16, 10, 4, 0, Math.PI); x.fill();
}
else {
// Default Circle
x.fillStyle = color;