mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Merge branch 'fix-pets-finally' into 'fix-pets-finally'
Add HaveToyItem + fix conflicts See merge request morningstar/Arcturus-Community!528
This commit is contained in:
commit
f09234a922
@ -46,14 +46,13 @@ public class InteractionPetTree extends InteractionDefault {
|
||||
super.onWalkOn(roomUnit, room, objects);
|
||||
|
||||
Pet pet = room.getPet(roomUnit);
|
||||
if (pet != null && pet.getPetData().getType() == 12 && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) {
|
||||
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) {
|
||||
RoomUnitStatus task = RoomUnitStatus.HANG;
|
||||
switch(pet.getTask()){
|
||||
case RING_OF_FIRE: task = RoomUnitStatus.RINGOFFIRE; break;
|
||||
case SWING: task = RoomUnitStatus.SWING; break;
|
||||
case ROLL: task = RoomUnitStatus.ROLL; break;
|
||||
}
|
||||
|
||||
if (pet.getEnergy() >= 35 && task != RoomUnitStatus.HANG) {
|
||||
|
||||
pet.getRoomUnit().setCanWalk(false);
|
||||
@ -99,7 +98,7 @@ public class InteractionPetTree extends InteractionDefault {
|
||||
@Override
|
||||
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) {
|
||||
Pet pet = room.getPet(roomUnit);
|
||||
return roomUnit.getRoomUnitType() == RoomUnitType.PET && pet != null;
|
||||
return roomUnit.getRoomUnitType() == RoomUnitType.PET && pet != null && pet.getPetData().haveToyItem(this.getBaseItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,10 +3,7 @@ package com.eu.habbo.habbohotel.pets;
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetToy;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.*;
|
||||
import com.eu.habbo.habbohotel.pets.actions.*;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
@ -207,7 +204,7 @@ public class PetManager {
|
||||
PetData.generalFoodItems.add(baseItem);
|
||||
else if (baseItem.getInteractionType().getType() == InteractionPetDrink.class)
|
||||
PetData.generalDrinkItems.add(baseItem);
|
||||
else if (baseItem.getInteractionType().getType() == InteractionPetToy.class)
|
||||
else if (baseItem.getInteractionType().getType() == InteractionPetToy.class || baseItem.getInteractionType().getType() == InteractionPetTree.class)
|
||||
PetData.generalToyItems.add(baseItem);
|
||||
} else {
|
||||
PetData data = this.getPetData(set.getInt("pet_id"));
|
||||
@ -219,7 +216,7 @@ public class PetManager {
|
||||
data.addFoodItem(baseItem);
|
||||
else if (baseItem.getInteractionType().getType() == InteractionPetDrink.class)
|
||||
data.addDrinkItem(baseItem);
|
||||
else if (baseItem.getInteractionType().getType() == InteractionPetToy.class)
|
||||
else if (baseItem.getInteractionType().getType() == InteractionPetToy.class || baseItem.getInteractionType().getType() == InteractionPetTree.class)
|
||||
data.addToyItem(baseItem);
|
||||
}
|
||||
}
|
||||
|
@ -2542,6 +2542,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
this.roomSpecialTypes.removePetDrink((InteractionPetDrink) item);
|
||||
} else if (item instanceof InteractionPetFood) {
|
||||
this.roomSpecialTypes.removePetFood((InteractionPetFood) item);
|
||||
} else if (item instanceof InteractionPetTree) {
|
||||
this.roomSpecialTypes.removeUndefined(item);
|
||||
} else if (item instanceof InteractionMoodLight) {
|
||||
this.roomSpecialTypes.removeUndefined(item);
|
||||
} else if (item instanceof InteractionPyramid) {
|
||||
@ -2578,6 +2580,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
this.roomSpecialTypes.removeUndefined(item);
|
||||
} else if (item instanceof InteractionSnowboardSlope) {
|
||||
this.roomSpecialTypes.removeUndefined(item);
|
||||
} else if (item instanceof InteractionBuildArea) {
|
||||
this.roomSpecialTypes.removeUndefined(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ public enum RoomUnitStatus {
|
||||
RELAX("rlx"),
|
||||
WINGS("wng", true),
|
||||
FLAME("flm"),
|
||||
RINGOFFIRE("rng"), // ring of fire for dragon, toy undone
|
||||
SWING("swg"), // same as roll but less energic, related to Dragon tree toy.
|
||||
HANG("hg"), // hang, related to Dragon tree toy. just hangs under the branch
|
||||
ROLL("rll"), // roll, related to Dragon tree toy. rolls around the branch
|
||||
RINGOFFIRE("rng", true),
|
||||
SWING("swg", true),
|
||||
HANG("hg", true),
|
||||
ROLL("rll", true),
|
||||
|
||||
RIP("rip"),
|
||||
GROW("grw"),
|
||||
@ -69,12 +69,7 @@ public enum RoomUnitStatus {
|
||||
|
||||
SLEEP_IN("slp-in"),
|
||||
SLEEP("slp", true),
|
||||
SLEEP_OUT("slp-out"),
|
||||
|
||||
RINGOFFIRE("rng"),
|
||||
SWING("swg"),
|
||||
HANG("hg"),
|
||||
ROLL("rll");
|
||||
SLEEP_OUT("slp-out");
|
||||
|
||||
public final String key;
|
||||
public final boolean removeWhenWalking;
|
||||
|
Loading…
Reference in New Issue
Block a user