class DiCusser(Skill):
def __init__(self, responder: Responder, memory_size: int = 15, reply_chance: int = 90, ):
super().__init__()
self.npc: AXNPC2 = AXNPC2(memory_size, reply_chance)
self._temp_str: str = ""
self.splitter: AXStringSplit = AXStringSplit()
self._initialized: bool = False
self.filter: Responder = responder
self._excluder: Excluder = Excluder()
self._excluder.add_starts_with("tell me")
self._excluder.add_ends_with("over")
self.annoyedq: AnnoyedQ = AnnoyedQ(5)
self.violenceTRG: PercentDripper = PercentDripper()
def input(self, ear: str, skin: str, eye: str):
# prevent class with other skills
if self._excluder.exclude(ear):
return
if not self._initialized:
self.npc.responder.queue = self.splitter.split(self.getKokoro().grimoireMemento.simpleLoad("blabberv4"))
self._initialized = True
if len(ear) == 0: # ***
return
# auto
if not len(super().getKokoro().toHeart.get("diblabber", "")) == 0:
super().getKokoro().toHeart["diblabber"] = ""
t = self.npc.forceRespond()
if len(t) == 0:
t = "hadouken"
self.algPartsFusion(4, APMad(t))
return
# triggered by usage of remembered repeating strings
self.annoyedq.learn(ear)
if self.annoyedq.AnnoyedLevel(ear,2):
if self.violenceTRG.drip():
self.algPartsFusion(4, APMad("attacking"))
return
self.algPartsFusion(4, APMad(self.npc.forceRespond()))
return
# filter escape
if not self.filter.strContainsResponse(ear):
return
# blabber
self._temp_str = self.npc.strRespond(ear)
if len(self._temp_str) > 0:
self.algPartsFusion(4, APMad(self.npc.forceRespond()))
if not self.npc.learn(ear):
# str learn
if not self.npc.strLearn(ear):
return
self.getKokoro().grimoireMemento.simpleSave("blabberv4", self.splitter.stringBuilder(self.npc.responder.queue))
def skillNotes(self, param: str) -> str:
if param == "notes":
return "cussing skill"
elif param == "triggers":
return "try cussing"
return "note unavalible"