the pear goes back to sleep
This commit is contained in:
@@ -13,6 +13,7 @@ import { BRAIN_MAP } from '../../logic/chibi-behaviour/brain-map';
|
||||
import { TranslateableComponent } from '../../components/translateable.component';
|
||||
import { Food } from '../../types/food';
|
||||
import { interval } from 'rxjs';
|
||||
import { ChibiState, STATES } from '../../types/chibi/chibi-state';
|
||||
|
||||
enum EInteractionMenuState {
|
||||
Neutral,
|
||||
@@ -20,6 +21,8 @@ enum EInteractionMenuState {
|
||||
Inventory
|
||||
}
|
||||
|
||||
const THINKING_INTERVAL: number = 10000;
|
||||
|
||||
@Component({
|
||||
selector: 'ff-interactions',
|
||||
imports: [HeaderComponent, InteractionCanvasComponent, FoodPantryComponent, InventoryComponent, ButtonComponent],
|
||||
@@ -46,16 +49,17 @@ export class InteractionsComponent extends TranslateableComponent {
|
||||
effect(() => {
|
||||
if (this.chibi()) {
|
||||
this.brain = BRAIN_MAP[this.chibi().name]!;
|
||||
this.brain.init(this.chibi());
|
||||
}
|
||||
})
|
||||
interval(1000).subscribe(() => {
|
||||
this.brain.exist(this.chibi());
|
||||
interval(THINKING_INTERVAL).subscribe(() => {
|
||||
this.brain.exist();
|
||||
})
|
||||
}
|
||||
|
||||
public interact(interaction: EChibiInteraction, item?: Food): void {
|
||||
console.log(`${interaction} ${this.chibi().name} and item ${item}`);
|
||||
this.brain.resolveInteraction(this.chibi(), interaction, item);
|
||||
this.brain.resolveInteraction(interaction, item);
|
||||
}
|
||||
|
||||
public openFoodPantry(): void {
|
||||
|
||||
Reference in New Issue
Block a user