mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Fix WiredGame
This commit is contained in:
parent
1a3f1a93fa
commit
27619f484f
@ -3,7 +3,10 @@ package com.eu.habbo.habbohotel.games.wired;
|
||||
import com.eu.habbo.habbohotel.games.*;
|
||||
import com.eu.habbo.habbohotel.games.freeze.FreezeGame;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
|
||||
public class WiredGame extends Game {
|
||||
public GameState state = GameState.RUNNING;
|
||||
@ -28,14 +31,42 @@ public class WiredGame extends Game {
|
||||
|
||||
@Override
|
||||
public boolean addHabbo(Habbo habbo, GameTeamColors teamColor) {
|
||||
this.room.giveEffect(habbo, FreezeGame.effectId + teamColor.type, -1);
|
||||
RoomUnit roomUnit = habbo.getRoomUnit();
|
||||
if (roomUnit.getEffectId() > 0)
|
||||
roomUnit.setPreviousEffectId(roomUnit.getEffectId(), roomUnit.getPreviousEffectEndTimestamp());
|
||||
this.room.giveEffect(habbo, FreezeGame.effectId + teamColor.type, -1, true);
|
||||
return super.addHabbo(habbo, teamColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeHabbo(Habbo habbo) {
|
||||
super.removeHabbo(habbo);
|
||||
this.room.giveEffect(habbo, 0, -1);
|
||||
RoomUnit roomUnit = habbo.getRoomUnit();
|
||||
Room room = this.room;
|
||||
if (room == null) return;
|
||||
|
||||
HabboItem topItem = room.getTopItemAt(roomUnit.getCurrentLocation().x, roomUnit.getCurrentLocation().y);
|
||||
int nextEffectM = 0;
|
||||
int nextEffectF = 0;
|
||||
int nextEffectDuration = -1;
|
||||
|
||||
if (topItem != null) {
|
||||
nextEffectM = topItem.getBaseItem().getEffectM();
|
||||
nextEffectF = topItem.getBaseItem().getEffectF();
|
||||
} else if (roomUnit.getPreviousEffectId() > 0) {
|
||||
nextEffectF = roomUnit.getPreviousEffectId();
|
||||
nextEffectM = roomUnit.getPreviousEffectId();
|
||||
nextEffectDuration = roomUnit.getPreviousEffectEndTimestamp();
|
||||
}
|
||||
|
||||
if (habbo.getHabboInfo().getGender().equals(HabboGender.M)) {
|
||||
room.giveEffect(habbo, nextEffectM, nextEffectDuration, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (habbo.getHabboInfo().getGender().equals(HabboGender.F)) {
|
||||
room.giveEffect(habbo, nextEffectF, nextEffectDuration, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user