Block 8 — Gear & Crafting (1 day)
Goal: Player crafts equipment at Gear Bench to give raccoons stat boosts. Another resource sink and raid prep lever.
Depends on: Block 5 (scrap + currency resources), Block 2 (roster, gear slot on FRaccoonData).
Deliverables
Gear DataTable (DT_Gear)
UDataTable using row struct FGearTableRow:
USTRUCT(BlueprintType)
struct FGearTableRow : public FTableRowBase {
UPROPERTY(EditAnywhere) FString DisplayName;
UPROPERTY(EditAnywhere) EStatType BoostedStat;
UPROPERTY(EditAnywhere) int32 StatModifier;
UPROPERTY(EditAnywhere) int32 ScrapCost;
UPROPERTY(EditAnywhere) int32 CurrencyCost;
};MVP Items:
| Row Name | Display Name | Stat | Modifier | Scrap | Currency |
|---|---|---|---|---|---|
SpeedBandana | Speed Bandana | Speed | +5 | 8 | $5 |
StealthScarf | Stealth Scarf | Stealth | +5 | 8 | $5 |
StrengthVest | Strength Vest | Strength | +5 | 8 | $5 |
Values are tunable. Cunning/Luck items as stretch. DataTable at Content/TrashNTreasure/Data/Tables/DT_Gear.uasset.
Gear Inventory
Internal state (extends URaccoonSubsystem — Raccoons, NamePool, OnRosterChanged, GearTable declared in prior blocks):
| Member | Type | Purpose |
|---|---|---|
GearInventory | TArray<FName> | Crafted-but-unequipped gear. Each entry is a row name from DT_Gear. Persisted in save data |
| Function | Signature | Purpose |
|---|---|---|
CraftGear | bool (FName GearRowName) | Look up FGearTableRow. Check UResourceSubsystem::CanAffordCost. Deduct scrap + currency. Add row name to inventory. Return success. |
GetGearInventory | TArray<FName> () | For UI display of available gear. |
URaccoonSubsystem::EquipGear / UnequipGear (C++)
Already declared in Block 2. Implementation:
EquipGear(FGuid RaccoonId, FName GearRow):
- Validate raccoon exists
- If raccoon already has gear equipped → return false (must unequip first)
- Validate
GearRowexists in inventory - Set
FRaccoonData::EquippedGearRowName = GearRow - Remove from inventory
- Broadcast
OnRosterChanged - Return true
UnequipGear(FGuid RaccoonId):
- Get current
EquippedGearRowName - If empty → return
NAME_None - Clear
EquippedGearRowName - Add row name back to inventory
- Broadcast
OnRosterChanged - Return row name
GetEffectiveStats — Gear Integration
Already implemented in Block 2. Now resolves gear:
FStatBlock GetEffectiveStats(FGuid Id) {
FRaccoonData* R = GetRaccoon_Internal(Id);
FStatBlock Result = R->BaseStats + R->TrainingBonus; // Base + Training
// Gear modifier
if (!R->EquippedGearRowName.IsNone()) {
FGearTableRow* Row = GearTable->FindRow<FGearTableRow>(R->EquippedGearRowName);
if (Row) {
Result.ModifyStat(Row->BoostedStat, Row->StatModifier);
}
}
// Clamp to 100 per stat
Result.ClampAll(0, 100);
// Hunger penalty (from Block 6) — applied after clamp
if (R->Status == ERaccoonStatus::Hungry) {
Result.Speed = FMath::FloorToInt(Result.Speed * 0.8f);
Result.Stealth = FMath::FloorToInt(Result.Stealth * 0.8f);
// ... all stats
}
return Result;
}Gear Bench Station UI (UTNTGearBenchUI)
UMG widget opened from Gear Bench station:
- Craftable items list: Each row shows item name, stat bonus, cost (scrap + currency). Craft button per row. Grayed if can’t afford.
- Inventory section: List of crafted gear not yet equipped. Text: “[Item Name] — +[N] [Stat]”
- Equip section: Opens roster view filtered to idle raccoons. Select raccoon → select gear from inventory → equip. Shows stat change preview.
DataAsset: DA_GearBench, relevant stat TBD (Cunning or Speed for post-MVP craft quality/speed), no storage cap for MVP.
Equip Flow via Roster UI
Update UTNTRosterWidget (from Block 2):
- Per raccoon card: gear slot now clickable
- Click empty slot → dropdown of inventory items → select →
EquipGear - Click equipped item → “Unequip” button →
UnequipGear - Stat display updates immediately to show effective stats including gear bonus
Done When
- Player crafts all 3 gear items at Gear Bench (scrap + currency deducted)
- Crafted gear appears in inventory
- Equip gear on raccoon → stat bonus visible in roster (effective stats include gear)
- Equipped gear affects raid encounter checks (sum of crew effective stats includes gear bonuses)
- Gear can be unequipped and returns to inventory
- Gear can be re-assigned to different raccoon
-
GetEffectiveStatscorrectly stacks base + training + gear, clamped to 100, then hunger penalty