the great renaming
This commit is contained in:
16
src/app/logic/chibi-behaviour/brain-map.ts
Normal file
16
src/app/logic/chibi-behaviour/brain-map.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { EChibiName } from "../../types/chibi/chibi-name";
|
||||
import { IBrain } from "./brain";
|
||||
import { Aperio } from "./brains/aperio.brain";
|
||||
|
||||
const APERIO = new Aperio();
|
||||
|
||||
export const BRAIN_MAP: Record<EChibiName, IBrain> = {
|
||||
[EChibiName.Aperio]: APERIO,
|
||||
[EChibiName.Basra]: APERIO,
|
||||
[EChibiName.Caethya]: APERIO,
|
||||
[EChibiName.Eos]: APERIO,
|
||||
[EChibiName.Evina]: APERIO,
|
||||
[EChibiName.Sol]: APERIO,
|
||||
[EChibiName.Sybil]: APERIO,
|
||||
[EChibiName.Vinera]: APERIO
|
||||
}
|
||||
9
src/app/logic/chibi-behaviour/brain.ts
Normal file
9
src/app/logic/chibi-behaviour/brain.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { EChibiInteraction } from "../../types/chibi/chibi-interaction";
|
||||
import { EChibiStateName } from "../../types/chibi/chibi-state-name";
|
||||
|
||||
export interface IBrain {
|
||||
|
||||
//function for time passegs + autonomous state changes
|
||||
|
||||
resolveInteraction(state: EChibiStateName, interaction: EChibiInteraction): EChibiStateName
|
||||
}
|
||||
42
src/app/logic/chibi-behaviour/brains/aperio.brain.ts
Normal file
42
src/app/logic/chibi-behaviour/brains/aperio.brain.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { EChibiInteraction } from "../../../types/chibi/chibi-interaction";
|
||||
import { EChibiStateName } from "../../../types/chibi/chibi-state-name";
|
||||
import { IBrain } from "../brain";
|
||||
|
||||
export class Aperio implements IBrain {
|
||||
resolveInteraction(state: EChibiStateName, interaction: EChibiInteraction): EChibiStateName {
|
||||
switch (state) {
|
||||
case EChibiStateName.Sleeping: return this.resolveSleepingInteraction(interaction);
|
||||
default: return EChibiStateName.Sleeping;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
pear mostly sleeps
|
||||
1/128 chance of waking her
|
||||
12/128 chance of her doing a grumble and going back to sleep
|
||||
visiting caethya will wake her up and go into lovey-dovey mode
|
||||
she has a 1/2048 chance of waking up on her own
|
||||
pears happyness goes up when she sleeps
|
||||
|
||||
pear never gets hungry
|
||||
but she accepts foods she likes, which raise her happyness
|
||||
as long as the same food is not offered thrice in a row (except banana split)
|
||||
|
||||
pears energy never goes down
|
||||
pear will accept fights and enjoys them
|
||||
pear will accept walks and enjoys them
|
||||
|
||||
pear will get sad if she is awake and you do not interact with her
|
||||
|
||||
pear gets offended if you suggest she go to sleep
|
||||
|
||||
after any interaction she has a 1/4 chance of going to sleep
|
||||
*/
|
||||
|
||||
private resolveSleepingInteraction(interaction: EChibiInteraction): EChibiStateName {
|
||||
if (EChibiInteraction.WakeUp) {
|
||||
return EChibiStateName.Awake;
|
||||
}
|
||||
return EChibiStateName.Sleeping;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user