From 8940b2d727c47a5321b78c99822794068d3a754c Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Apr 2022 22:44:47 +0000 Subject: [PATCH] Add Bounce command --- .../habbohotel/pets/actions/ActionBounce.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionBounce.java diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionBounce.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionBounce.java new file mode 100644 index 00000000..6b042a8f --- /dev/null +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionBounce.java @@ -0,0 +1,32 @@ +package com.eu.habbo.habbohotel.pets.actions; + +import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.pets.Pet; +import com.eu.habbo.habbohotel.pets.PetAction; +import com.eu.habbo.habbohotel.pets.PetVocalsType; +import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; +import com.eu.habbo.habbohotel.users.Habbo; +import com.eu.habbo.threading.runnables.PetClearPosture; + +public class ActionBounce extends PetAction { + public ActionBounce() { + super(null, true); + + this.minimumActionDuration = 1000; + this.statusToSet.add(RoomUnitStatus.BOUNCE); + } + + // bouncy bounce + @Override + public boolean apply(Pet pet, Habbo habbo, String[] data) { + + if (pet.getHappyness() > 50) { + Emulator.getThreading().run(new PetClearPosture(pet, RoomUnitStatus.BOUNCE, null, false), this.minimumActionDuration); + pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); + return true; + } else { + pet.say(pet.getPetData().randomVocal(PetVocalsType.DISOBEY)); + return false; + } + } +}