Skip to content

Commit

Permalink
Improve semperfi-js some more.
Browse files Browse the repository at this point in the history
- Fix most linter warnings.
- Fix being without power before building a generator in a T2/T3 no bases setting.
- Fix instances where labs were being demolished early game.
- Fix focus on scavengers when attacked by them.
- Fix truck hover recycle not working if unfinished defenses exist somewhere.
- Change build logic for factories and labs. Now based on derrick count.
- Change eventAttacked to allow its units to flee if outnumbered vastly.
- Change auto-building of defenses so that it does not happen after base structures.
- Change it so production goes first then research (cases where no droids were built).
- Add the ability to randomly build hardened sensor towers near derricks along with defenses.
- Add the ability to build a defense near a stolen oil resource, if enemy.
- Add the ability to research and produce bunker-buster weapons.
- Add a new VTOL scan function and adapt research if enemy has any VTOLs.
- Remove beacon drop functionality because of performance reasons.
  • Loading branch information
KJeff01 committed Jun 30, 2018
1 parent cc7c912 commit e9b67a4
Show file tree
Hide file tree
Showing 9 changed files with 673 additions and 351 deletions.
41 changes: 23 additions & 18 deletions data/mp/multiplay/skirmish/semperfi.js
@@ -1,35 +1,40 @@

// -- definitions
const OIL_RES = "OilResource";
const RES_LAB = "A0ResearchFacility";
const POW_GEN = "A0PowerGenerator";
const FACTORY = "A0LightFactory";
const DERRICK = "A0ResourceExtractor";
const CYBORG_FACTORY = "A0CyborgFactory";
const PLAYER_HQ = "A0CommandCentre";
const VTOL_PAD = "A0VtolPad";
const VTOL_FACTORY = "A0VTolFactory1";
const REPAIR_FACILITY = "A0RepairCentre3";
const CB_TOWER = "Sys-CB-Tower01";
const WIDE_SPECTRUM_TOWER = "Sys-SensoTowerWS";
const UPLINK = "A0Sat-linkCentre";
const OIL_RES_STAT = "OilResource";
const RES_LAB_STAT = "A0ResearchFacility";
const POW_GEN_STAT = "A0PowerGenerator";
const FACTORY_STAT = "A0LightFactory";
const DERRICK_STAT = "A0ResourceExtractor";
const CYBORG_FACTORY_STAT = "A0CyborgFactory";
const PLAYER_HQ_STAT = "A0CommandCentre";
const VTOL_PAD_STAT = "A0VtolPad";
const VTOL_FACTORY_STAT = "A0VTolFactory1";
const REPAIR_FACILITY_STAT = "A0RepairCentre3";
const SENSOR_TOWERS = ["Sys-SensoTower02", "Sys-SensoTowerWS"];
const UPLINK_STAT = "A0Sat-linkCentre";
const ELECTRONIC_DEFENSES = ["Sys-SpyTower", "WallTower-EMP", "Emplacement-MortarEMP"];

// -- globals
const MIN_TRUCKS = 6;
const MIN_POWER = 210;
const MIN_BUILD_POWER = 230;
const MIN_BASE_TRUCKS = 3;
const MIN_OIL_TRUCKS = 4;
const MIN_BUILD_POWER = 80;
const MIN_RESEARCH_POWER = -50;
const MIN_PRODUCTION_POWER = 60;
const MIN_BUSTERS = 5;
const HELP_CONSTRUCT_AREA = 20;
const AVG_BASE_RADIUS = 20; // Magic, but how will we determine the size of a "base" anyway.
const BASE = startPositions[me];
var attackGroup;
var busterGroup;
var vtolGroup;
var baseBuilders;
var oilBuilders;
var researchDone = false;
var researchDone;
var truckRoleSwapped;
var isSeaMap; // Used to determine if it is a hover map.
var lastBeaconDrop = 0; // last game time SemperFi sent a beacon.
var currentEnemy; // Current enemy SemperFi is attacking.
var currentEnemyTick; // Last time the enemy was changed.
var enemyHasVtol;

//And include the rest here.
include("/multiplay/skirmish/semperfi_includes/performance.js");
Expand Down

0 comments on commit e9b67a4

Please sign in to comment.