| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
- from hermes_python.ontology import *
- from hermes_python.hermes import Hermes
- import random
- import Action_Base
- @Action_Base.Snips("Beleidigend","insult")
- class Action_Beleidigend(Action_Base.Action_Base):
- def getMessage(self, intent_message):
- if len(intent_message.slots)>0:
- multiplier=1.0
- bel1=""
- bel2=""
- if intent_message is not None:
- if intent_message.slots.Beleidigung != None and len(intent_message.slots.Beleidigung)>0:
- bel = str(intent_message.slots.Beleidigung.first().value)
- if intent_message.slots.Beleidigung2 != None and len(intent_message.slots.Beleidigung2)>0:
- bel1 = str(intent_message.slots.Beleidigung2.first().value)
- if intent_message.slots.Multiplier != None and len(intent_message.slots.Multiplier)>0:
- multiplier+=0.35
- if intent_message.slots.Multiplier2 != None and len(intent_message.slots.Multiplier2)>0:
- multiplier+=0.2
-
- if(bel=="heavyRude"):
- self.common.modState("angry", 250 * multiplier)
- self.common.modState("happyness", -250 * multiplier)
- self.common.modState("depresive", 22*multiplier)
- elif(bel=="softRude"):
- self.common.modState("angry", 50 * multiplier)
- self.common.modState("happyness", -20 * multiplier)
- self.common.modState("depresive", 22*multiplier)
- else:
- self.common.modState("angry", 100 * multiplier)
- self.common.modState("happyness", -90 * multiplier)
- self.common.modState("depresive", 22*multiplier)
- if(bel2=="heavyRude"):
- self.common.modState("angry", 100 * multiplier)
- self.common.modState("happyness", -100 * multiplier)
- self.common.modState("depresive", 22*multiplier)
- elif(bel2=="softRude"):
- self.common.modState("angry", 30 * multiplier)
- self.common.modState("happyness", -10 * multiplier)
- self.common.modState("depresive", 10*multiplier)
- else:
- self.common.modState("angry", 80 * multiplier)
- self.common.modState("happyness", -30 * multiplier)
- self.common.modState("depresive", 14*multiplier)
- return self.getMoodMessage()
|