use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class ScenarioPrecombatMaster method generateLocation.
private static void generateLocation() {
location = new Location(getScenario());
Dungeon dungeon = location.construct();
// DC_Game.game.getDungeonMaster().setDungeon(dungeon);
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class ObjectiveMaster method initObjectiveTrigger.
public static void initObjectiveTrigger(OBJECTIVE_TYPE type, String data, Location mission) {
Dungeon dungeon = mission.getBossLevel();
objectiveData = data;
STANDARD_EVENT_TYPE eventType = null;
Conditions conditions = new Conditions();
Abilities abilities = new Abilities();
abilities.add(new ActiveAbility(new FixedTargeting(), new EndGameEffect(true)));
Ref ref = new Ref();
Integer id = null;
String name;
switch(type) {
case BOSS:
eventType = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_KILLED;
Coordinates c = DC_ObjInitializer.getCoordinatesFromObjString(objectiveData);
// new Coordinates(s);
name = DC_ObjInitializer.getNameFromObjString(objectiveData);
// conditions.add(new ObjComparison(KEY, KEYS.TARGET.toString()));
break;
case CAPTURE_HOLD:
// "As long as
break;
case SURVIVE_TIME:
break;
case ESCAPE:
// eventType = STANDARD_EVENT_TYPE.UNIT_GONE_THRU_ENTRANCE;
break;
case ITEM:
break;
}
// some objectives will be initialized on a condition, e.g. capture-hold
addTrigger(eventType, conditions, abilities);
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class IlluminationMaster method getIllumination.
public Integer getIllumination(Unit source, DC_Obj target) {
Integer illumination = 0;
if (source == master.getSeeingUnit()) {
illumination = cache.get(target);
if (illumination != null) {
return illumination;
}
}
Ref ref = new Ref(source);
ref.setMatch(target.getId());
if (target.getVisibilityLevel() == VISIBILITY_LEVEL.BLOCKED) {
// master.getSightMaster().getClearShotCondition().preCheck(ref)
// cache.put(target, -1);
// return -1;
illumination = 0;
} else
illumination = target.getIntParam(PARAMS.ILLUMINATION);
Dungeon dungeon = source.getGame().getDungeon();
illumination += target.getIntParam(PARAMS.LIGHT_EMISSION) / 2;
if (dungeon != null) {
illumination = Math.max(illumination, dungeon.getGlobalIllumination());
globalIllumination = dungeon.getGlobalIllumination() / 5;
}
// universal
illumination += globalIllumination;
if (illumination <= 0)
return illumination;
double ilMod;
double distance = PositionMaster.getExactDistance(source.getCoordinates(), target.getCoordinates());
// from 200 to 25 on diff of 8 to -5
// def sight range of 5, I'd say
Integer sight = source.getSightRangeTowards(target);
// sight*=2; //TODO NEW
double diff = sight - distance;
if (diff < 0) {
ilMod = 100 + diff * 100 / ClearShotCondition.SIGHT_RANGE_FACTOR;
// - diff * diff * 2
} else {
// + Math.sqrt(diff * 65)));
ilMod = (100 + (diff * 12));
}
ilMod = Math.min(ilMod, 300);
ilMod = Math.max(ilMod, 1);
// TODO DISTANCE FACTOR?
illumination = (int) Math.round(illumination * ilMod / 100);
cache.put(target, illumination);
return illumination;
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class Location method newSublevel.
private Dungeon newSublevel(Dungeon dungeon, ObjType type, int z, int level, ENTRANCE_LAYOUT entranceLayout) {
ObjType dungeonType = new ObjType(type);
if (level != 0) {
dungeonType.setName(type.getName() + ", Level " + level);
}
String group = type.getSubGroupingKey();
String path = PathFinder.getDungeonLevelFolder() + group + "\\";
File file = FileManager.getRandomFile(path);
String data = FileManager.readFile(file);
DungeonPlan plan = new LocationBuilder().loadDungeonMap(data);
adjustPlanToEntrance(plan, entranceLayout, file.getName());
new LocationBuilder().transformDungeonPlan(plan);
Dungeon sublevel = new Dungeon(dungeonType);
// dungeon.getSubLevels().add(sublevel);
return sublevel;
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class WanderAi method getMaxWanderTotalDistance.
public static int getMaxWanderTotalDistance(GroupAI group, GOAL_TYPE type) {
Boolean x_y_diag = !group.getWanderDirection().isVertical();
if (group.getWanderDirection().isDiagonal()) {
x_y_diag = null;
}
Dungeon dungeon = group.getLeader().getGame().getDungeon();
switch(type) {
case SEARCH:
// keep the distance from the *target*, not origin...
case STALK:
}
// group.getLeader().getGame().getDungeon().getCellsX()
if (x_y_diag == null) {
return (int) Math.round(Math.sqrt(dungeon.getSquare()) * getDistanceFactor(type, group));
}
if (x_y_diag) {
return Math.round(dungeon.getCellsX() * getDistanceFactor(type, group));
}
return Math.round(dungeon.getCellsY() * getDistanceFactor(type, group));
// TODO maybe the block, the zone? Whole dungeon could be huge... or
// small...
}
Aggregations