Skip to content
Snippets Groups Projects
Commit 9449f62a authored by Tim Huppertz's avatar Tim Huppertz Committed by Nik | Klampfradler
Browse files

Added behaviour changes.

parent 5cef5bc4
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ from datetime import datetime
from PyQt4 import uic
from ConfigParser import ConfigParser
from koalaConfig import KoalaConfig
from random import randint
import os
import dbus
......@@ -47,6 +48,7 @@ class Koala():
self.name = "Tim"
self.animal = "koala"
self.timeout = 60000
self.sickness = 0
self.load()
......@@ -54,9 +56,10 @@ class Koala():
if datetime.now() > datetime.strptime(datetime.now().strftime("%d.%m.%Y") + " " + self.brushtime, "%d.%m.%Y %H:%M") and self.brushed < datetime.strptime(datetime.now().strftime("%d.%m.%Y") + " " + self.brushtime, "%d.%m.%Y %H:%M"):
return "dirty-teeth"
if self.hunger < 0:
return "fat"
elif self.hunger >= 10:
if self.sickness >= 20:
return "sick"
if self.hunger >= 10:
return "hungry"
if self.dirtiness >= 10:
......@@ -94,6 +97,29 @@ class Koala():
if self.exhaustion < 30:
self.exhaustion += 0.5
if self.get_mood() == "dirty-teeth":
self.happiness -= 1
self.sickness += 0.5
if self.get_mood() == "hungry":
self.happiness -= 1
if self.get_mood() == "fat":
self.happiness -= 1
self.loneliness += 2
self.sickness += 0.5
if self.get_mood() == "dirty":
self.sickness += 0.5
if self.get_mood() == "sick":
self.loneliness += 2
self.happiness -= 2
self.dirtiness += 2
if randint(0, 100) % 4 == 0:
self.sickness += 1
self.save()
def save(self):
......@@ -170,6 +196,7 @@ class Koala():
self.happiness += 5
self.hunger -= 1
self.loneliness -= 5
self.sickness -= 5
def bonbon(self):
self.weight += 2
......@@ -180,6 +207,7 @@ class Koala():
def hug(self):
self.happiness += 2
self.loneliness -= 2
self.sickness -= 0.5
def walk(self):
self.happiness += 5
......@@ -190,6 +218,7 @@ class Koala():
def sleep(self):
self.exhaustion -= 20
self.dirtiness += 1
self.sickness -= 0.5
class Deskoala(plasmascript.Applet):
def __init__(self,parent,args=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment