mirror of
https://github.com/simtactics/servo.git
synced 2025-03-15 00:21:20 +00:00
Increased max mood and motive, resepctfully.
- Function for printing motives and mood
This commit is contained in:
parent
373170f98e
commit
9d74a1690e
1 changed files with 43 additions and 31 deletions
|
@ -23,21 +23,14 @@
|
|||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"For this experiment, the current motives are randomized with a max of 10. If this were a game, the max would be 100 with a downward increment throughout the day."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"static Random rng = new Random();\n",
|
||||
"static int MaxMood = 60;\n",
|
||||
"static int MaxMotive = 10;\n",
|
||||
"static int MaxMood = 600;\n",
|
||||
"static int MaxMotive = 100;\n",
|
||||
"\n",
|
||||
"static int LimitToRange(this int val, int min, int max)\n",
|
||||
"{\n",
|
||||
|
@ -133,6 +126,16 @@
|
|||
" {\n",
|
||||
" Social = CalcuateMotiveChange(Social, input);\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" public void ChangeEnergy(int input)\n",
|
||||
" {\n",
|
||||
" Energy = CalcuateMotiveChange(Energy, input);\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" public void ChangeEnvironment(int input)\n",
|
||||
" {\n",
|
||||
" Environment = CalcuateMotiveChange(Environment, input);\n",
|
||||
" }\n",
|
||||
"}"
|
||||
],
|
||||
"outputs": []
|
||||
|
@ -142,19 +145,15 @@
|
|||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"// Max a motive can be is 10. With all motives combined, the\n",
|
||||
"// the max can be about 60. In-game, this is always going down\n",
|
||||
"// to whatever degree.\n",
|
||||
"var motives = new Motives(hunger: rng.Next(MaxMotive), \n",
|
||||
"bladder: rng.Next(MaxMotive), fun: rng.Next(MaxMotive), \n",
|
||||
"energy: rng.Next(MaxMotive), environment: MaxMotive, \n",
|
||||
"social: rng.Next(MaxMotive));\n",
|
||||
"Console.WriteLine($\"Hunger: {motives.Hunger}{Environment.NewLine}\" +\n",
|
||||
" $\"Fun: {motives.Fun}{Environment.NewLine}\" +\n",
|
||||
" $\"Bladder: {motives.Bladder}{Environment.NewLine}\" +\n",
|
||||
" $\"Social: {motives.Social}{Environment.NewLine}\" +\n",
|
||||
" $\"Environment: {motives.Environment}\");\n",
|
||||
"Console.WriteLine($\"Mood: {motives.Mood}\");"
|
||||
"void PrintMotives(Motives motives)\n",
|
||||
"{\n",
|
||||
" Console.WriteLine($\"Hunger: {motives.Hunger}{Environment.NewLine}\" +\n",
|
||||
" $\"Fun: {motives.Fun}{Environment.NewLine}\" +\n",
|
||||
" $\"Bladder: {motives.Bladder}{Environment.NewLine}\" +\n",
|
||||
" $\"Social: {motives.Social}{Environment.NewLine}\" +\n",
|
||||
" $\"Environment: {motives.Environment}\");\n",
|
||||
" Console.WriteLine($\"Mood: {motives.Mood}\");\n",
|
||||
"}"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
|
@ -163,15 +162,28 @@
|
|||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"motives.ChangeHunger(rng.Next(MaxMotive));\n",
|
||||
"motives.ChangeFun(rng.Next(MaxMotive));\n",
|
||||
"motives.ChangeSocial(rng.Next(MaxMotive));\n",
|
||||
"motives.ChangeBladder(rng.Next(MaxMotive));\n",
|
||||
"Console.WriteLine($\"New Hunger: {motives.Hunger}{Environment.NewLine}\" +\n",
|
||||
" $\"New Fun: {motives.Fun}{Environment.NewLine}\" +\n",
|
||||
" $\"New Bladder: {motives.Bladder}{Environment.NewLine}\" +\n",
|
||||
" $\"New Social: {motives.Social}\");\n",
|
||||
"Console.WriteLine($\"New Mood: {motives.Mood}\");"
|
||||
"var motives = new Motives(hunger: rng.Next(MaxMotive), \n",
|
||||
"bladder: rng.Next(MaxMotive), fun: rng.Next(MaxMotive), \n",
|
||||
"energy: rng.Next(MaxMotive), environment: rng.Next(MaxMotive), \n",
|
||||
"social: rng.Next(MaxMotive));\n",
|
||||
"\n",
|
||||
"PrintMotives(motives);"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"motives.ChangeHunger(rng.Next(motives.Hunger, MaxMotive));\n",
|
||||
"motives.ChangeFun(rng.Next(motives.Fun, MaxMotive));\n",
|
||||
"motives.ChangeSocial(rng.Next(motives.Social, MaxMotive));\n",
|
||||
"motives.ChangeBladder(rng.Next(motives.Bladder, MaxMotive));\n",
|
||||
"motives.ChangeEnergy(rng.Next(motives.Energy, MaxMotive));\n",
|
||||
"motives.ChangeEnvironment(rng.Next(motives.Environment, MaxMotive));\n",
|
||||
"\n",
|
||||
"PrintMotives(motives);"
|
||||
],
|
||||
"outputs": []
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue