mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-15 13:54:51 +01:00
Implement setting headicons/skins
This commit is contained in:
@@ -295,35 +295,11 @@ public class Character implements GameDatabaseObject {
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
var skinData = GameData.getCharacterSkinDataTable().get(skinId);
|
||||
if (skinData == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure we have the skin
|
||||
if (skinData.getCharId() != this.getCharId()) {
|
||||
if (!getPlayer().getInventory().hasSkin(skinId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (skinData.getType()) {
|
||||
case 1:
|
||||
// Default skin, always allow
|
||||
break;
|
||||
case 2:
|
||||
// Ascension skin, only allow if the character has the right ascension level
|
||||
if (this.getAdvance() < this.getData().getAdvanceSkinUnlockLevel()) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Extra skin, only allow if we have the skin unlocked
|
||||
if (!getPlayer().getInventory().getExtraSkins().contains(skinId)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Set skin
|
||||
this.skin = skinId;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user