mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 02:42:53 +08:00
Fix dropType
de-serialization
enum edition
This commit is contained in:
parent
ecb6145e54
commit
b5595c3fab
@ -3,9 +3,10 @@ package emu.grasscutter.data.binout;
|
|||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import emu.grasscutter.data.common.DynamicFloat;
|
import emu.grasscutter.data.common.DynamicFloat;
|
||||||
import emu.grasscutter.game.props.ElementType;
|
import emu.grasscutter.game.props.ElementType;
|
||||||
import java.io.Serializable;
|
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class AbilityModifier implements Serializable {
|
public class AbilityModifier implements Serializable {
|
||||||
private static final long serialVersionUID = -2001232313615923575L;
|
private static final long serialVersionUID = -2001232313615923575L;
|
||||||
|
|
||||||
@ -327,7 +328,7 @@ public class AbilityModifier implements Serializable {
|
|||||||
public AbilityModifierAction[] successActions;
|
public AbilityModifierAction[] successActions;
|
||||||
public AbilityModifierAction[] failActions;
|
public AbilityModifierAction[] failActions;
|
||||||
|
|
||||||
public int dropType;
|
public DropType dropType = DropType.LevelControl;
|
||||||
public DynamicFloat baseEnergy;
|
public DynamicFloat baseEnergy;
|
||||||
public DynamicFloat ratio = DynamicFloat.ONE;
|
public DynamicFloat ratio = DynamicFloat.ONE;
|
||||||
public int configID;
|
public int configID;
|
||||||
@ -335,6 +336,12 @@ public class AbilityModifier implements Serializable {
|
|||||||
public int param1;
|
public int param1;
|
||||||
public int param2;
|
public int param2;
|
||||||
public int param3;
|
public int param3;
|
||||||
|
|
||||||
|
public enum DropType {
|
||||||
|
LevelControl,
|
||||||
|
BigWorldOnly,
|
||||||
|
ForceDrop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following should be implemented into DynamicFloat if older resource formats need to be
|
// The following should be implemented into DynamicFloat if older resource formats need to be
|
||||||
|
@ -5,6 +5,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
|
|||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
|
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
|
||||||
|
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction.DropType;
|
||||||
import emu.grasscutter.data.binout.config.ConfigLevelEntity;
|
import emu.grasscutter.data.binout.config.ConfigLevelEntity;
|
||||||
import emu.grasscutter.game.ability.Ability;
|
import emu.grasscutter.game.ability.Ability;
|
||||||
import emu.grasscutter.game.entity.EntityAvatar;
|
import emu.grasscutter.game.entity.EntityAvatar;
|
||||||
@ -28,8 +29,8 @@ public final class ActionGenerateElemBall extends AbilityActionHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we should allow elem ball generation
|
//Check if we should allow elem ball generation
|
||||||
if (action.dropType == 0x0) {
|
if(action.dropType == DropType.LevelControl) {
|
||||||
String levelEntityConfig = owner.getScene().getSceneData().getLevelEntityConfig();
|
String levelEntityConfig = owner.getScene().getSceneData().getLevelEntityConfig();
|
||||||
ConfigLevelEntity config = GameData.getConfigLevelEntityDataMap().get(levelEntityConfig);
|
ConfigLevelEntity config = GameData.getConfigLevelEntityDataMap().get(levelEntityConfig);
|
||||||
if (config != null
|
if (config != null
|
||||||
@ -38,8 +39,8 @@ public final class ActionGenerateElemBall extends AbilityActionHandler {
|
|||||||
Grasscutter.getLogger().warn("This level config don't allow element balls");
|
Grasscutter.getLogger().warn("This level config don't allow element balls");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (action.dropType == 0x1) {
|
} else if(action.dropType == DropType.BigWorldOnly) {
|
||||||
if (owner.getScene().getSceneData().getSceneType() != SceneType.SCENE_WORLD) {
|
if(owner.getScene().getSceneData().getSceneType() != SceneType.SCENE_WORLD) {
|
||||||
Grasscutter.getLogger().warn("This level config only allows element balls on big world");
|
Grasscutter.getLogger().warn("This level config only allows element balls on big world");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user