mirror of
https://github.com/Anime-Game-Servers/AnimeGamesLua.git
synced 2024-11-26 22:00:32 +00:00
[Refactoring] Replaced some enum values and lua tables with direct representations of the content for the handler
* Also added some enums required for that
This commit is contained in:
parent
ff03ca7507
commit
301c524c6e
@ -0,0 +1,9 @@
|
||||
package org.anime_game_servers.gi_lua.models.constants;
|
||||
|
||||
public enum ChallengeEventMarkType {
|
||||
CHALLENGE_EVENT_NONE,
|
||||
FLIGHT_TIME,
|
||||
FLIGHT_GATHER_POINT,
|
||||
SUMMER_TIME_SPRINT_BOAT_TIME,
|
||||
SUMMER_TIME_SPRINT_BOAT_GATHER_POINT
|
||||
}
|
@ -124,4 +124,10 @@ public class EventType {
|
||||
public static final int EVENT_PLATFORM_ARRIVAL = 2701;
|
||||
public static final int EVENT_PLAYER_BACK_GALLERY_REVIVE_POINT = 2800;
|
||||
public static final int EVENT_GALLERY_CANNOT_START_AFTER_COUNTDOWN = 2801;
|
||||
public static final int EVENT_CUSTOM_GADGET_SLOT_MAP_CHANGED = 3000;
|
||||
public static final int EVENT_GRAVEN_PHOTO_REFRESH_GROUP = 3001;
|
||||
public static final int EVENT_GADGET_CHAIN_LEVEL_CHANGE = 3101;
|
||||
public static final int EVENT_GCG_TAVERN_SCENE_REFRESH = 3200;
|
||||
public static final int EVENT_CHAR_AMUSEMENT_DUNGEON_ALL_PLAYER_ENTER = 3201;
|
||||
public static final int EVENT_TRAINING_FUNGUS_SELECT_DONE = 3202;
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
package org.anime_game_servers.gi_lua.models.constants;
|
||||
|
||||
public enum ExhibitionPlayType {
|
||||
Challenge,
|
||||
Gallery,
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package org.anime_game_servers.gi_lua.models.constants;
|
||||
|
||||
public enum FatherChallengeProperty {
|
||||
DURATION,
|
||||
CUR_SUCC,
|
||||
CUR_FAIL,
|
||||
SUM_SUCC,
|
||||
SUM_FAIL
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.anime_game_servers.gi_lua.models.constants.temporary;
|
||||
package org.anime_game_servers.gi_lua.models.constants;
|
||||
|
||||
public enum FlowSuiteOperatePolicy {
|
||||
DEFAULT,
|
@ -0,0 +1,24 @@
|
||||
package org.anime_game_servers.gi_lua.models.constants;
|
||||
|
||||
import kotlin.collections.MapsKt;
|
||||
import org.anime_game_servers.lua.models.IntValueEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum QuestState implements IntValueEnum {
|
||||
NONE(0),
|
||||
UNSTARTED(1),
|
||||
UNFINISHED(2),
|
||||
FINISHED(3),
|
||||
FAILED(4);
|
||||
private final int value;
|
||||
|
||||
private QuestState(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package org.anime_game_servers.gi_lua.models.constants.temporary;
|
||||
|
||||
public enum ExhibitionPlayType {
|
||||
Challenge,
|
||||
Gallery,
|
||||
}
|
@ -4,8 +4,8 @@ import io.github.oshai.kotlinlogging.KLogger;
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging;
|
||||
import lombok.val;
|
||||
import org.anime_game_servers.gi_lua.models.constants.*;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.ExhibitionPlayType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.FlowSuiteOperatePolicy;
|
||||
import org.anime_game_servers.gi_lua.models.constants.ExhibitionPlayType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.FlowSuiteOperatePolicy;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.GalleryProgressScoreType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.GalleryProgressScoreUIType;
|
||||
import org.anime_game_servers.gi_lua.script_lib.ScriptLib;
|
||||
@ -71,14 +71,14 @@ public interface GIScriptLoader extends BaseScriptLoader {
|
||||
}
|
||||
|
||||
default void addDefaultsForEngine(LuaEngine luaEngine){
|
||||
//luaEngine.addGlobalEnumByIntValue("QuestState", QuestState.values());
|
||||
luaEngine.addGlobalEnumByIntValue("QuestState", QuestState.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("EntityType", EntityType.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("ElementType", ElementType.values());
|
||||
|
||||
luaEngine.addGlobalEnumByOrdinal("GroupKillPolicy", GroupKillPolicy.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("SealBattleType", SealBattleType.values());
|
||||
//luaEngine.addGlobalEnumByOrdinal("FatherChallengeProperty", FatherChallengeProperty.values());
|
||||
//luaEngine.addGlobalEnumByOrdinal("ChallengeEventMarkType", ChallengeEventMarkType.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("FatherChallengeProperty", FatherChallengeProperty.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("ChallengeEventMarkType", ChallengeEventMarkType.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("VisionLevelType", VisionLevelType.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("ExhibitionPlayType", ExhibitionPlayType.values());
|
||||
luaEngine.addGlobalEnumByOrdinal("FlowSuiteOperatePolicy", FlowSuiteOperatePolicy.values());
|
||||
|
@ -1,6 +1,14 @@
|
||||
package org.anime_game_servers.gi_lua.script_lib;
|
||||
|
||||
import io.github.oshai.kotlinlogging.KLogger;
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging;
|
||||
import lombok.val;
|
||||
import org.anime_game_servers.gi_lua.models.constants.*;
|
||||
import org.anime_game_servers.gi_lua.models.constants.ExhibitionPlayType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.FlowSuiteOperatePolicy;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.GalleryProgressScoreType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.GalleryProgressScoreUIType;
|
||||
import org.anime_game_servers.lua.engine.LuaTable;
|
||||
|
||||
import static org.anime_game_servers.gi_lua.utils.ScriptUtils.posToLua;
|
||||
|
||||
@ -10,6 +18,7 @@ public class ScriptLib {
|
||||
* Context free functions
|
||||
*/
|
||||
|
||||
private static KLogger scriptLogger = KotlinLogging.INSTANCE.logger(ScriptLib.class.getName());
|
||||
public static ScriptLibStaticHandler staticHandler;
|
||||
public static void PrintLog(String msg) {
|
||||
staticHandler.PrintLog(msg);
|
||||
@ -77,13 +86,28 @@ public class ScriptLib {
|
||||
}
|
||||
|
||||
public static int AddExtraFlowSuite(GroupEventLuaContext context, int groupId, int suiteId, int flowSuitePolicy){
|
||||
return context.getScriptLibHandler().AddExtraFlowSuite(context, groupId, suiteId, flowSuitePolicy);
|
||||
if(flowSuitePolicy < 0 || flowSuitePolicy >= FlowSuiteOperatePolicy.values().length){
|
||||
scriptLogger.error(() -> "[AddExtraFlowSuite] Invalid flow suite policy " + flowSuitePolicy);
|
||||
return 1;
|
||||
}
|
||||
val flowSuitePolicyEnum = FlowSuiteOperatePolicy.values()[flowSuitePolicy];
|
||||
return context.getScriptLibHandler().AddExtraFlowSuite(context, groupId, suiteId, flowSuitePolicyEnum);
|
||||
}
|
||||
public static int RemoveExtraFlowSuite(GroupEventLuaContext context, int groupId, int suiteId, int flowSuitePolicy){
|
||||
return context.getScriptLibHandler().RemoveExtraFlowSuite(context, groupId, suiteId, flowSuitePolicy);
|
||||
if(flowSuitePolicy < 0 || flowSuitePolicy >= FlowSuiteOperatePolicy.values().length){
|
||||
scriptLogger.error(() -> "[RemoveExtraFlowSuite] Invalid flow suite policy " + flowSuitePolicy);
|
||||
return 1;
|
||||
}
|
||||
val flowSuitePolicyEnum = FlowSuiteOperatePolicy.values()[flowSuitePolicy];
|
||||
return context.getScriptLibHandler().RemoveExtraFlowSuite(context, groupId, suiteId, flowSuitePolicyEnum);
|
||||
}
|
||||
public static int KillExtraFlowSuite(GroupEventLuaContext context, int groupId, int suiteId, int flowSuitePolicy){
|
||||
return context.getScriptLibHandler().KillExtraFlowSuite(context, groupId, suiteId, flowSuitePolicy);
|
||||
if(flowSuitePolicy < 0 || flowSuitePolicy >= FlowSuiteOperatePolicy.values().length){
|
||||
scriptLogger.error(() -> "[KillExtraFlowSuite] Invalid flow suite policy " + flowSuitePolicy);
|
||||
return 1;
|
||||
}
|
||||
val flowSuitePolicyEnum = FlowSuiteOperatePolicy.values()[flowSuitePolicy];
|
||||
return context.getScriptLibHandler().KillExtraFlowSuite(context, groupId, suiteId, flowSuitePolicyEnum);
|
||||
}
|
||||
|
||||
public static int ActiveChallenge(GroupEventLuaContext context, int challengeIndex, int challengeId, int timeLimitOrGroupId, int groupId, int objectiveKills, int param5) {
|
||||
@ -170,12 +194,23 @@ public class ScriptLib {
|
||||
|
||||
public static int GetRegionEntityCount(GroupEventLuaContext context, Object rawTable) {
|
||||
val table = context.getEngine().getTable(rawTable);
|
||||
return context.getScriptLibHandler().GetRegionEntityCount(context, table);
|
||||
|
||||
|
||||
int regionId = table.getInt("region_eid");
|
||||
int entityType = table.getInt("entity_type");
|
||||
if(entityType < 0 || entityType >= EntityType.values().length){
|
||||
scriptLogger.error(() -> "Invalid entity type " + entityType);
|
||||
return 0;
|
||||
}
|
||||
val entityTypeEnum = EntityType.values()[entityType];
|
||||
|
||||
return context.getScriptLibHandler().GetRegionEntityCount(context, regionId, entityTypeEnum);
|
||||
}
|
||||
|
||||
public int GetRegionConfigId(GroupEventLuaContext context, Object rawTable){
|
||||
val table = context.getEngine().getTable(rawTable);
|
||||
return context.getScriptLibHandler().GetRegionConfigId(context, table);
|
||||
val regionEid = table.getInt("region_eid");
|
||||
return context.getScriptLibHandler().GetRegionConfigId(context, regionEid);
|
||||
}
|
||||
|
||||
public static int TowerCountTimeStatus(GroupEventLuaContext context, int isDone, int var2){
|
||||
@ -254,18 +289,19 @@ public class ScriptLib {
|
||||
}
|
||||
|
||||
public static int GetHostQuestState(GroupEventLuaContext context, int questId){
|
||||
return context.getScriptLibHandler().GetHostQuestState(context, questId);
|
||||
return context.getScriptLibHandler().GetHostQuestState(context, questId).getValue();
|
||||
}
|
||||
|
||||
public static int GetQuestState(GroupEventLuaContext context, int entityId, int questId){
|
||||
return context.getScriptLibHandler().GetQuestState(context, entityId, questId);
|
||||
return context.getScriptLibHandler().GetQuestState(context, entityId, questId).getValue();
|
||||
}
|
||||
|
||||
public static int ShowReminder(GroupEventLuaContext context, int reminderId){
|
||||
return context.getScriptLibHandler().ShowReminder(context, reminderId);
|
||||
}
|
||||
|
||||
public static int RemoveEntityByConfigId(GroupEventLuaContext context, int groupId, int entityType, int configId){
|
||||
public static int RemoveEntityByConfigId(GroupEventLuaContext context, int groupId, int entityTypeValue, int configId){
|
||||
val entityType = EntityType.values()[entityTypeValue];
|
||||
return context.getScriptLibHandler().RemoveEntityByConfigId(context, groupId, entityType, configId);
|
||||
}
|
||||
|
||||
@ -333,8 +369,19 @@ public class ScriptLib {
|
||||
return context.getScriptLibHandler().StartFatherChallenge(context, challengeIndex);
|
||||
}
|
||||
public static int ModifyFatherChallengeProperty(GroupEventLuaContext context, int challengeId, int propertyTypeIndex, int value){
|
||||
return context.getScriptLibHandler().ModifyFatherChallengeProperty(context, challengeId, propertyTypeIndex, value);
|
||||
val propertyType = FatherChallengeProperty.values()[propertyTypeIndex];
|
||||
return context.getScriptLibHandler().ModifyFatherChallengeProperty(context, challengeId, propertyType, value);
|
||||
}
|
||||
|
||||
public static int SetChallengeEventMark(GroupEventLuaContext context, int challengeId, int markType){
|
||||
if(markType < 0 || markType >= ChallengeEventMarkType.values().length){
|
||||
scriptLogger.error(() -> "Invalid mark type " + markType);
|
||||
return 1;
|
||||
}
|
||||
val markTypeEnum = ChallengeEventMarkType.values()[markType];
|
||||
return context.getScriptLibHandler().SetChallengeEventMark(context, challengeId, markTypeEnum);
|
||||
}
|
||||
|
||||
public static int AttachChildChallenge(GroupEventLuaContext context, int fatherChallengeIndex, int childChallengeIndex,
|
||||
int childChallengeId, Object var4Table, Object var5Table, Object var6Table){
|
||||
val conditionArray = context.getEngine().getTable(var4Table);
|
||||
@ -398,9 +445,51 @@ public class ScriptLib {
|
||||
return context.getScriptLibHandler().ExpeditionChallengeEnterRegion(context, var1);
|
||||
}
|
||||
|
||||
public static int StartSealBattle(GroupEventLuaContext context, int gadgetId, Object var2Table) {
|
||||
val var2 = context.getEngine().getTable(var2Table);
|
||||
return context.getScriptLibHandler().StartSealBattle(context, gadgetId, var2);
|
||||
public static int StartSealBattle(GroupEventLuaContext context, int gadgetId, Object battleParamsTable) {
|
||||
val battleParams = context.getEngine().getTable(battleParamsTable);
|
||||
val battleType = battleParams.optInt("battle_type", -1);
|
||||
if(battleType < 0 || battleType >= SealBattleType.values().length){
|
||||
scriptLogger.error(() -> "Invalid battle type " + battleType);
|
||||
return -1;
|
||||
}
|
||||
val battleTypeEnum = SealBattleType.values()[battleType];
|
||||
val handlerParams = switch (battleTypeEnum){
|
||||
case NONE -> parseSealBattleNoneParams(battleParams);
|
||||
case KILL_MONSTER -> parseSealBattleMonsterKillParams(battleParams);
|
||||
case ENERGY_CHARGE -> parseEnergySealBattleTimeParams(battleParams);
|
||||
};
|
||||
return context.getScriptLibHandler().StartSealBattle(context, gadgetId, handlerParams);
|
||||
}
|
||||
|
||||
private static SealBattleParams parseSealBattleNoneParams(LuaTable battleParams){
|
||||
val radius = battleParams.optInt("radius", -1);
|
||||
val inAdd = battleParams.optInt("in_add", -1);
|
||||
val outSub = battleParams.optInt("out_sub", -1);
|
||||
val failTime = battleParams.optInt("fail_time", -1);
|
||||
val maxProgress = battleParams.optInt("max_progress", -1);
|
||||
// TODO check params and maybe return error?
|
||||
return new DefaultSealBattleParams(radius, inAdd, outSub, failTime, maxProgress);
|
||||
}
|
||||
|
||||
private static SealBattleParams parseSealBattleMonsterKillParams(LuaTable battleParams){
|
||||
val radius = battleParams.optInt("radius", -1);
|
||||
val killTime = battleParams.optInt("kill_time", -1);
|
||||
val monsterGroupId = battleParams.optInt("monster_group_id", -1);
|
||||
val maxProgress = battleParams.optInt("max_progress", -1);
|
||||
// TODO check params and maybe return error?
|
||||
return new MonsterSealBattleParams(radius, killTime, monsterGroupId, maxProgress);
|
||||
}
|
||||
|
||||
private static SealBattleParams parseEnergySealBattleTimeParams(LuaTable battleParams){
|
||||
val radius = battleParams.optInt("radius", -1);
|
||||
val battleTime = battleParams.optInt("battle_time", -1);
|
||||
val monsterGroupId = battleParams.optInt("monster_group_id", -1);
|
||||
val defaultKillCharge = battleParams.optInt("default_kill_charge", -1);
|
||||
val autoCharge = battleParams.optInt("auto_charge", -1);
|
||||
val autoDecline = battleParams.optInt("auto_decline", -1);
|
||||
val maxEnergy = battleParams.optInt("max_energy", -1);
|
||||
// TODO check params and maybe return error?
|
||||
return new EnergySealBattleParams(radius, battleTime, monsterGroupId, defaultKillCharge, autoCharge, autoDecline, maxEnergy);
|
||||
}
|
||||
|
||||
public static int InitTimeAxis(GroupEventLuaContext context, String var1, Object var2Table, boolean var3){
|
||||
@ -471,12 +560,37 @@ public class ScriptLib {
|
||||
public static int InitGalleryProgressScore(GroupEventLuaContext context, String name, int galleryId, Object progressTable,
|
||||
int scoreUiTypeIndex, int scoreTypeIndex) {
|
||||
val progress = context.getEngine().getTable(progressTable);
|
||||
return context.getScriptLibHandler().InitGalleryProgressScore(context, name, galleryId, progress, scoreUiTypeIndex, scoreTypeIndex);
|
||||
|
||||
if(scoreUiTypeIndex < 0 || scoreUiTypeIndex >= GalleryProgressScoreUIType.values().length){
|
||||
scriptLogger.error(() -> "[InitGalleryProgressScore] Invalid score ui type " + scoreUiTypeIndex);
|
||||
return 1;
|
||||
}
|
||||
val uiScoreType = GalleryProgressScoreUIType.values()[scoreUiTypeIndex];
|
||||
|
||||
if(scoreTypeIndex < 0 || scoreTypeIndex >= GalleryProgressScoreType.values().length){
|
||||
scriptLogger.error(() -> "[InitGalleryProgressScore] Invalid score type " + scoreTypeIndex);
|
||||
return 2;
|
||||
}
|
||||
val scoreType = GalleryProgressScoreType.values()[scoreTypeIndex];
|
||||
return context.getScriptLibHandler().InitGalleryProgressScore(context, name, galleryId, progress, uiScoreType, scoreType);
|
||||
}
|
||||
public static int InitGalleryProgressWithScore(GroupEventLuaContext context, String name, int galleryId, Object progressTable,
|
||||
int maxProgress, int scoreUiTypeIndex, int scoreTypeIndex) {
|
||||
val progress = context.getEngine().getTable(progressTable);
|
||||
return context.getScriptLibHandler().InitGalleryProgressWithScore(context, name, galleryId, progress, maxProgress, scoreUiTypeIndex, scoreTypeIndex);
|
||||
|
||||
if(scoreUiTypeIndex < 0 || scoreUiTypeIndex >= GalleryProgressScoreUIType.values().length){
|
||||
scriptLogger.error(() -> "[InitGalleryProgressWithScore] Invalid score ui type " + scoreUiTypeIndex);
|
||||
return 1;
|
||||
}
|
||||
val uiScoreType = GalleryProgressScoreUIType.values()[scoreUiTypeIndex];
|
||||
|
||||
if(scoreTypeIndex < 0 || scoreTypeIndex >= GalleryProgressScoreType.values().length){
|
||||
scriptLogger.error(() -> "[InitGalleryProgressWithScore] Invalid score type " + scoreTypeIndex);
|
||||
return 2;
|
||||
}
|
||||
val scoreType = GalleryProgressScoreType.values()[scoreTypeIndex];
|
||||
|
||||
return context.getScriptLibHandler().InitGalleryProgressWithScore(context, name, galleryId, progress, maxProgress, uiScoreType, scoreType);
|
||||
}
|
||||
public static int AddGalleryProgressScore(GroupEventLuaContext context, String name, int galleryId, int score) {
|
||||
return context.getScriptLibHandler().AddGalleryProgressScore(context, name, galleryId, score);
|
||||
@ -637,7 +751,35 @@ public class ScriptLib {
|
||||
|
||||
public static int KillGroupEntity(GroupEventLuaContext context, Object rawTable) {
|
||||
val table = context.getEngine().getTable(rawTable);
|
||||
return context.getScriptLibHandler().KillGroupEntity(context, table);
|
||||
val groupId = table.optInt("group_id", -1);
|
||||
val killPolicyId = table.optInt("kill_policy", -1);
|
||||
if(groupId == -1){
|
||||
scriptLogger.error(() -> "KillGroupEntity: groupId not set");
|
||||
return 1;
|
||||
}
|
||||
if(killPolicyId == -1){
|
||||
scriptLogger.error(() -> "KillGroupEntity: kill_policy not set");
|
||||
return killByCfgIds(context, groupId, table);
|
||||
}
|
||||
return killByGroupPolicy(context, groupId, killPolicyId);
|
||||
}
|
||||
|
||||
private static int killByGroupPolicy(GroupEventLuaContext context, int groupId, int killPolicyId){
|
||||
if(killPolicyId >= GroupKillPolicy.values().length){
|
||||
scriptLogger.error(() -> "KillGroupEntity: kill_policy out of bounds");
|
||||
return 2;
|
||||
}
|
||||
val policy = GroupKillPolicy.values()[killPolicyId];
|
||||
return context.getScriptLibHandler().KillGroupEntityByPolicy(context, groupId, policy);
|
||||
}
|
||||
|
||||
private static int killByCfgIds(GroupEventLuaContext context, int groupId, LuaTable luaTable){
|
||||
val monsterList = luaTable.getTable("monsters");
|
||||
val gadgetList = luaTable.getTable("gadgets");
|
||||
val monsters = monsterList != null ? monsterList.getAsIntArray() : new int[0];
|
||||
val gadgets = gadgetList != null ? gadgetList.getAsIntArray() : new int[0];
|
||||
|
||||
return context.getScriptLibHandler().KillGroupEntityByCfgIds(context, groupId, monsters, gadgets);
|
||||
}
|
||||
|
||||
public static int GetGadgetIdByEntityId(GroupEventLuaContext context, int entityId){
|
||||
@ -738,7 +880,18 @@ public class ScriptLib {
|
||||
*/
|
||||
public static int AddExhibitionAccumulableDataAfterSuccess(GroupEventLuaContext context, int uid, String param2, int param3, Object param4Table){
|
||||
val param4 = context.getEngine().getTable(param4Table);
|
||||
return context.getScriptLibHandler().AddExhibitionAccumulableDataAfterSuccess(context, uid, param2, param3, param4);
|
||||
val exhibitionTypeIndex = param4.optInt("play_type", -1);
|
||||
val galleryId = param4.optInt("gallery_id", -1);
|
||||
if(exhibitionTypeIndex < 0 || exhibitionTypeIndex >= ExhibitionPlayType.values().length){
|
||||
scriptLogger.error(() -> "Invalid exhibition type " + exhibitionTypeIndex);
|
||||
return 1;
|
||||
}
|
||||
if (galleryId == -1){
|
||||
scriptLogger.error(() -> "Invalid gallery id " + galleryId);
|
||||
return 2;
|
||||
}
|
||||
val exhibitionTypeEnum = ExhibitionPlayType.values()[exhibitionTypeIndex];
|
||||
return context.getScriptLibHandler().AddExhibitionAccumulableDataAfterSuccess(context, uid, param2, param3, exhibitionTypeEnum, galleryId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,10 +1,14 @@
|
||||
package org.anime_game_servers.gi_lua.script_lib;
|
||||
|
||||
import org.anime_game_servers.gi_lua.models.Position;
|
||||
import org.anime_game_servers.gi_lua.models.PositionImpl;
|
||||
import org.anime_game_servers.gi_lua.models.constants.*;
|
||||
import org.anime_game_servers.gi_lua.models.constants.ExhibitionPlayType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.FlowSuiteOperatePolicy;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.GalleryProgressScoreType;
|
||||
import org.anime_game_servers.gi_lua.models.constants.temporary.GalleryProgressScoreUIType;
|
||||
import org.anime_game_servers.lua.engine.LuaTable;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext, ControllerEventContext extends ControllerLuaContext<?>> {
|
||||
@ -35,9 +39,9 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
int RemoveExtraGroupSuite(GroupEventContext context, int groupId, int suite);
|
||||
int KillExtraGroupSuite(GroupEventContext context, int groupId, int suite);
|
||||
|
||||
int AddExtraFlowSuite(GroupEventContext context, int groupId, int suiteId, int flowSuitePolicy);
|
||||
int RemoveExtraFlowSuite(GroupEventContext context, int groupId, int suiteId, int flowSuitePolicy);
|
||||
int KillExtraFlowSuite(GroupEventContext context, int groupId, int suiteId, int flowSuitePolicy);
|
||||
int AddExtraFlowSuite(GroupEventContext context, int groupId, int suiteId, FlowSuiteOperatePolicy flowSuitePolicy);
|
||||
int RemoveExtraFlowSuite(GroupEventContext context, int groupId, int suiteId, FlowSuiteOperatePolicy flowSuitePolicy);
|
||||
int KillExtraFlowSuite(GroupEventContext context, int groupId, int suiteId, FlowSuiteOperatePolicy flowSuitePolicy);
|
||||
|
||||
int ActiveChallenge(GroupEventContext context, int challengeIndex, int challengeId, int timeLimitOrGroupId, int groupId, int objectiveKills, int param5);
|
||||
|
||||
@ -80,9 +84,9 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
*/
|
||||
int RefreshGroup(GroupEventContext context, LuaTable table);
|
||||
|
||||
int GetRegionEntityCount(GroupEventContext context, LuaTable table);
|
||||
int GetRegionEntityCount(GroupEventContext context, int regionEId, EntityType entityType);
|
||||
|
||||
int GetRegionConfigId(GroupEventContext context, LuaTable table);
|
||||
int GetRegionConfigId(GroupEventContext context, int regionEId);
|
||||
|
||||
int TowerCountTimeStatus(GroupEventContext context, int isDone, int var2);
|
||||
int GetGroupMonsterCount(GroupEventContext context);
|
||||
@ -118,10 +122,10 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
int ChangeGroupGadget(GroupEventContext context, LuaTable table) ;
|
||||
|
||||
int GetSceneOwnerUid(GroupEventContext context);
|
||||
int GetHostQuestState(GroupEventContext context, int questId);
|
||||
int GetQuestState(GroupEventContext context, int entityId, int questId);
|
||||
@Nonnull QuestState GetHostQuestState(GroupEventContext context, int questId);
|
||||
@Nonnull QuestState GetQuestState(GroupEventContext context, int entityId, int questId);
|
||||
int ShowReminder(GroupEventContext context, int reminderId);
|
||||
int RemoveEntityByConfigId(GroupEventContext context, int groupId, int entityType, int configId);
|
||||
int RemoveEntityByConfigId(GroupEventContext context, int groupId, EntityType entityType, int configId);
|
||||
int CreateGroupTimerEvent(GroupEventContext context, int groupID, String source, double time);
|
||||
int CancelGroupTimerEvent(GroupEventContext context, int groupID, String source);
|
||||
|
||||
@ -141,7 +145,8 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
int sendCloseCommonTipsToClient(GroupEventContext context);
|
||||
int CreateFatherChallenge(GroupEventContext context, int challengeIndex, int challengeId, int timeLimit, LuaTable conditionTable);
|
||||
int StartFatherChallenge(GroupEventContext context, int challengeIndex);
|
||||
int ModifyFatherChallengeProperty(GroupEventContext context, int challengeId, int propertyTypeIndex, int value);
|
||||
int ModifyFatherChallengeProperty(GroupEventContext context, int challengeId, FatherChallengeProperty propertyTypeIndex, int value);
|
||||
int SetChallengeEventMark(GroupEventContext context, int challengeId, ChallengeEventMarkType eventMarkType);
|
||||
int AttachChildChallenge(GroupEventContext context, int fatherChallengeIndex, int childChallengeIndex,
|
||||
int childChallengeId, LuaTable var4, LuaTable var5, LuaTable var6);
|
||||
int CreateEffigyChallengeMonster(GroupEventContext context, int var1, LuaTable var2Table);
|
||||
@ -161,7 +166,7 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
|
||||
int FinishExpeditionChallenge(GroupEventContext context);
|
||||
int ExpeditionChallengeEnterRegion(GroupEventContext context, boolean var1);
|
||||
int StartSealBattle(GroupEventContext context, int gadgetId, LuaTable var2);
|
||||
int StartSealBattle(GroupEventContext context, int gadgetId, SealBattleParams params);
|
||||
|
||||
int InitTimeAxis(GroupEventContext context, String var1, LuaTable var2, boolean var3);
|
||||
int EndTimeAxis(GroupEventContext context, String var1);
|
||||
@ -193,9 +198,9 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
|
||||
int UpdatePlayerGalleryScore(GroupEventContext context, int galleryId, LuaTable var2);
|
||||
int InitGalleryProgressScore(GroupEventContext context, String name, int galleryId, LuaTable progressTable,
|
||||
int scoreUiTypeIndex, int scoreTypeIndex);
|
||||
GalleryProgressScoreUIType scoreUiType, GalleryProgressScoreType scoreType);
|
||||
int InitGalleryProgressWithScore(GroupEventContext context, String name, int galleryId, LuaTable progress,
|
||||
int maxProgress, int scoreUiTypeIndex, int scoreTypeIndex);
|
||||
int maxProgress, GalleryProgressScoreUIType scoreUiType, GalleryProgressScoreType scoreType);
|
||||
int AddGalleryProgressScore(GroupEventContext context, String name, int galleryId, int score);
|
||||
int GetGalleryProgressScore(GroupEventContext context, String name, int galleryId) ;
|
||||
int SetHandballGalleryBallPosAndRot(GroupEventContext context, int galleryId, LuaTable positionTable, LuaTable rotationTable);
|
||||
@ -273,7 +278,8 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
|
||||
int LockForce(GroupEventContext context, int force);
|
||||
|
||||
int KillGroupEntity(GroupEventContext context, LuaTable table);
|
||||
int KillGroupEntityByCfgIds(GroupEventContext context, int groupId, int[] monsters, int[] gadgets);
|
||||
int KillGroupEntityByPolicy(GroupEventContext context, int groupId, GroupKillPolicy policy);
|
||||
int GetGadgetIdByEntityId(GroupEventContext context, int entityId);
|
||||
int GetMonsterIdByEntityId(GroupEventContext context, int entityId);
|
||||
int GetMonsterConfigId(GroupEventContext context, int entityId);
|
||||
@ -323,10 +329,11 @@ public interface ScriptLibHandler<GroupEventContext extends GroupEventLuaContext
|
||||
* @param uid
|
||||
* @param param2 probably the name of the data field
|
||||
* @param param3
|
||||
* @param param4 contains the fields "play_type" is part of the enum [ExhibitionPlayType] and "gallery_id"
|
||||
* @param exhibitionPlayType
|
||||
* @param galleryId
|
||||
* @return
|
||||
*/
|
||||
int AddExhibitionAccumulableDataAfterSuccess(GroupEventContext context, int uid, String param2, int param3, LuaTable param4);
|
||||
int AddExhibitionAccumulableDataAfterSuccess(GroupEventContext context, int uid, String param2, int param3, ExhibitionPlayType exhibitionPlayType, int galleryId);
|
||||
|
||||
/**
|
||||
* TODO implement
|
||||
|
@ -0,0 +1,39 @@
|
||||
package org.anime_game_servers.gi_lua.script_lib
|
||||
|
||||
import org.anime_game_servers.gi_lua.models.constants.SealBattleType
|
||||
|
||||
interface SealBattleParams {
|
||||
val sealBattleType: SealBattleType
|
||||
val radius: Int
|
||||
}
|
||||
|
||||
data class EnergySealBattleParams(
|
||||
override val radius: Int,
|
||||
val battleTime: Int,
|
||||
val monsterGroupId: Int,
|
||||
val defaultKillCharge: Int,
|
||||
val autoCharge: Int,
|
||||
val autoDecline: Int,
|
||||
val maxEnergy: Int,
|
||||
) : SealBattleParams {
|
||||
override val sealBattleType: SealBattleType = SealBattleType.ENERGY_CHARGE
|
||||
}
|
||||
|
||||
data class DefaultSealBattleParams(
|
||||
override val radius: Int,
|
||||
val inAdd: Int,
|
||||
val outSub: Int,
|
||||
val failTime: Int,
|
||||
val maxProgress: Int,
|
||||
) : SealBattleParams {
|
||||
override val sealBattleType: SealBattleType = SealBattleType.NONE
|
||||
}
|
||||
|
||||
data class MonsterSealBattleParams(
|
||||
override val radius: Int,
|
||||
val kill_time: Int,
|
||||
val monster_group_id: Int,
|
||||
val maxProgress: Int,
|
||||
) : SealBattleParams {
|
||||
override val sealBattleType : SealBattleType = SealBattleType.KILL_MONSTER
|
||||
}
|
Loading…
Reference in New Issue
Block a user