Advertisement
Rocket_Cat

engi offense

Dec 15th, 2019
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s.calc = function() {
  2.    
  3.     //any stimjector-related things to do?
  4.     if ('stimjector' in vs.myDefs) {
  5.         //our stimjector is auto
  6.         if (vs.switchingStim) {
  7.             //we are switching to manual.
  8.             return 'gsv.stimjector';
  9.         }
  10.     } else if (vs.abs.gst.rdy) {
  11.         //our stimjector is manual
  12.         if (vs.switchingStim) {
  13.             //we are switching to auto
  14.             return 'gston';
  15.         }
  16.         //do we need to heal manually?
  17.         var threshold = vs.settings.hp_threshold;
  18.         if (vs.vitals.hp < threshold) {
  19.             return 'gst';
  20.         }
  21.     }
  22.     var droneHere = vs.botHere('an aerodynamic drone')
  23.     // do we need parts? Let's check if we have airdrop balance.
  24.     if ( (vs.vitals.parts < vs.settings.airdropPartsThreshold) && vs.abs.bai.rdy) {
  25.         //is the drone here?
  26.         if (droneHere) {
  27.             vs.verb('Vuu found that we need to airdrop.','engineer');
  28.             return 'bai';
  29.         //oh shit, no drone. Let's salvage a wormholer
  30.         } else if (vs.myGadgets['an arm-mounted wormhole generator'].length > 1) {
  31.             return 'gsv.wormholer';
  32.         //out of wormholers? Salvage a hoverboard
  33.         } else if (vs.myGadgets['a wing-shaped hoverboard'].length > 1) {
  34.             return 'gsv.hoverboard';
  35.         } else {
  36.             display_notice('=======NO GADGETS TO SALVAGE FOR PARTS!======','red');
  37.         }
  38.     }
  39.     //we really really want a carrybot at all times so we can interrupt
  40.     if (!('a crane-armed carrybot' in vs.myBots)) {
  41.         return 'bcon.carrybot';
  42.     }
  43.     //we also really want a shardflinger in the room.
  44.     if (!vs.turretHere('a turret with a mounted shardflinger barrel')) {
  45.         if ('a turret with a mounted shardflinger barrel' in vs.myTurrets) {
  46.             if (vs.myTurrets['a turret with a mounted shardflinger barrel'].length >0) {
  47.                 var id = vs.myTurrets['a turret with a mounted shardflinger barrel'][0];
  48.                 return 'tde.'+id;
  49.             }
  50.         }
  51.         display_notice('=======NEED A TURRET BUT HAVE NONE!======','red');
  52.     } else {
  53.         //so we do have a shardflinger here. But is it sentrymode?
  54.         var tId = vs.getMyTurretHere();
  55.         if (tId) {
  56.             if (!(tId in vs.mySentryTurrets)) {
  57.                 //Not really sure... it could be... let's use a balanceless TURRET STATUS to check
  58.                 vs.turretStatusParsingId = tId;
  59.                 return 'tst';
  60.             }
  61.         }
  62.         //we DO have a turret here and apparently it's out of energy.
  63.         if (vs.boost) {
  64.             vs.verb('Vuu found that we need to qpcboost.','engineer');
  65.             return 'qpc';
  66.         }
  67.     }
  68.     //remove them from cover.
  69.     if (vs.theirCoverState.covering) {
  70.         vs.verb('Vuu found that we need to propshrink.','engineer');
  71.         return 'gps';
  72.     }
  73.     //harass them on cd
  74.     if (droneHere && vs.abs.bha.rdy) {
  75.         return 'bha';
  76.     }
  77.    
  78.     var sh = vs.shardCounter;
  79.     //5 shards is our money number for magnetize. Let's check...
  80.     if (sh >= 5) {
  81.         //We want shard counts to hover around 5/6, not 4/5, so let's check if shards are falling
  82.         if (vs.shardCountIn(5000) < 5) { // checks if shards 5 seconds from now will be less than 5.
  83.             //they are, so let's junkjet.
  84.             display_notice('====Time to magnotron?====','yellow');
  85.             return 'gj';
  86.         } else {
  87.             //magnetize yaaaah
  88.             return 'gmz';
  89.         }
  90.     }
  91.     //NYI DO NOT UNCOMMENT YET
  92.     //we want them either spasming or with weak knees
  93.     /*if (!vs.spasming) {
  94.         return 'gsp';
  95.     } else {
  96.     //and now we want to make sure they have damaged right/left leg, conveniently also telling us if they are indeed weak knees.
  97.         if ( (vs.constrictCount < 2) && (vs.botHere('a knife-mawed burrowbot')) ) {
  98.             return 'bco';
  99.         }
  100.     }
  101.     */
  102.    
  103.     //we will constrict them by default.
  104.     return false;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement