Levelup City Implementation (#2281)

* add statue promo data

* implement levelup city feature

* fix get level city when enter game

* format code

* fix typo, remove some property in the player, add the field cityInfoData to player class
This commit is contained in:
Phong
2023-08-12 10:54:19 +07:00
committed by GitHub
parent d0dde1c9e2
commit bdc4b5af89
8 changed files with 214 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
package emu.grasscutter.game.city;
import dev.morphia.annotations.Entity;
import emu.grasscutter.net.proto.CityInfoOuterClass.CityInfo;
import lombok.Getter;
import lombok.Setter;
@Entity
public class CityInfoData {
@Getter @Setter private int cityId;
@Getter @Setter
private int level = 1; // level of the city (include level SotS, level Frostbearing Trees, etc.)
@Getter @Setter private int numCrystal = 0; // number of crystals in the city
public CityInfoData(int cityId) {
this.cityId = cityId;
}
public CityInfo toProto() {
return CityInfo.newBuilder()
.setCityId(cityId)
.setLevel(level)
.setCrystalNum(numCrystal)
.build();
}
}