Screeps Wiki
Advertisement

function (enabled) {

   if (!this.my) {
     return C.ERR_NOT_OWNER;
   }
   if (!_.isBoolean(enabled)) {
     return C.ERR_INVALID_ARGS;
   }
   if (enabled != data(this.id).notifyWhenAttacked) {
     intents[this.id] = intents[this.id] || {};
     intents[this.id].notifyWhenAttacked = {enabled: enabled};
   }
   return C.OK;
 }

Advertisement