@@ -358,7 +358,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
358
358
if ( ! target . energy ) {
359
359
return C . ERR_NOT_ENOUGH_RESOURCES ;
360
360
}
361
- if ( ! target . pos . isNearTo ( this . pos ) ) {
361
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_HARVEST_SOURCE ) ) {
362
362
return C . ERR_NOT_IN_RANGE ;
363
363
}
364
364
if ( this . room . controller && (
@@ -373,7 +373,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
373
373
if ( ! target . mineralAmount ) {
374
374
return C . ERR_NOT_ENOUGH_RESOURCES ;
375
375
}
376
- if ( ! target . pos . isNearTo ( this . pos ) ) {
376
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_HARVEST_MINERAL ) ) {
377
377
return C . ERR_NOT_IN_RANGE ;
378
378
}
379
379
var extractor = _ . find ( target . pos . lookFor ( 'structure' ) , { structureType : C . STRUCTURE_EXTRACTOR } ) ;
@@ -481,7 +481,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
481
481
}
482
482
}
483
483
484
- if ( ! target . pos . isNearTo ( this . pos ) ) {
484
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_TRANSFER ) ) {
485
485
return C . ERR_NOT_IN_RANGE ;
486
486
}
487
487
if ( ! data ( this . id ) [ resourceType ] ) {
@@ -629,7 +629,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
629
629
}
630
630
}
631
631
632
- if ( ! target . pos . isNearTo ( this . pos ) ) {
632
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_WITHDRAW ) ) {
633
633
return C . ERR_NOT_IN_RANGE ;
634
634
}
635
635
@@ -701,7 +701,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
701
701
if ( utils . calcResources ( this . carry ) >= this . carryCapacity ) {
702
702
return C . ERR_FULL ;
703
703
}
704
- if ( ! target . pos . isNearTo ( this . pos ) ) {
704
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_PICKUP ) ) {
705
705
return C . ERR_NOT_IN_RANGE ;
706
706
}
707
707
@@ -739,7 +739,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
739
739
return C . ERR_INVALID_TARGET ;
740
740
}
741
741
742
- if ( ! target . pos . isNearTo ( this . pos ) ) {
742
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_ATTACK ) ) {
743
743
return C . ERR_NOT_IN_RANGE ;
744
744
}
745
745
@@ -767,7 +767,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
767
767
register . assertTargetObject ( target ) ;
768
768
return C . ERR_INVALID_TARGET ;
769
769
}
770
- if ( ! this . pos . inRangeTo ( target , 3 ) ) {
770
+ if ( ! this . pos . inRangeTo ( target , C . RANGE_RANGED_ATTACK ) ) {
771
771
return C . ERR_NOT_IN_RANGE ;
772
772
}
773
773
@@ -816,7 +816,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
816
816
register . assertTargetObject ( target ) ;
817
817
return C . ERR_INVALID_TARGET ;
818
818
}
819
- if ( ! target . pos . isNearTo ( this . pos ) ) {
819
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_HEAL ) ) {
820
820
return C . ERR_NOT_IN_RANGE ;
821
821
}
822
822
if ( this . room . controller && ! this . room . controller . my && this . room . controller . safeMode ) {
@@ -875,7 +875,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
875
875
register . assertTargetObject ( target ) ;
876
876
return C . ERR_INVALID_TARGET ;
877
877
}
878
- if ( ! this . pos . inRangeTo ( target , 3 ) ) {
878
+ if ( ! this . pos . inRangeTo ( target , C . RANGE_REPAIR ) ) {
879
879
return C . ERR_NOT_IN_RANGE ;
880
880
}
881
881
@@ -902,7 +902,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
902
902
register . assertTargetObject ( target ) ;
903
903
return C . ERR_INVALID_TARGET ;
904
904
}
905
- if ( ! this . pos . inRangeTo ( target , 3 ) ) {
905
+ if ( ! this . pos . inRangeTo ( target , C . RANGE_BUILD ) ) {
906
906
return C . ERR_NOT_IN_RANGE ;
907
907
}
908
908
@@ -985,7 +985,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
985
985
if ( ! _hasActiveBodypart ( this . body , C . CLAIM ) ) {
986
986
return C . ERR_NO_BODYPART ;
987
987
}
988
- if ( ! target . pos . isNearTo ( this . pos ) ) {
988
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_CLAIM_CONTROLLER ) ) {
989
989
return C . ERR_NOT_IN_RANGE ;
990
990
}
991
991
if ( target . structureType != 'controller' ) {
@@ -1021,7 +1021,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
1021
1021
if ( ! _getActiveBodyparts ( this . body , C . CLAIM ) ) {
1022
1022
return C . ERR_NO_BODYPART ;
1023
1023
}
1024
- if ( ! target . pos . isNearTo ( this . pos ) ) {
1024
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_ATTACK_CONTROLLER ) ) {
1025
1025
return C . ERR_NOT_IN_RANGE ;
1026
1026
}
1027
1027
if ( ! target . owner && ! target . reservation ) {
@@ -1059,7 +1059,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
1059
1059
if ( target . upgradeBlocked && target . upgradeBlocked > 0 ) {
1060
1060
return C . ERR_INVALID_TARGET ;
1061
1061
}
1062
- if ( ! target . pos . inRangeTo ( this . pos , 3 ) ) {
1062
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_UPGRADE_CONTROLLER ) ) {
1063
1063
return C . ERR_NOT_IN_RANGE ;
1064
1064
}
1065
1065
if ( ! target . my ) {
@@ -1086,7 +1086,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
1086
1086
register . assertTargetObject ( target ) ;
1087
1087
return C . ERR_INVALID_TARGET ;
1088
1088
}
1089
- if ( ! target . pos . isNearTo ( this . pos ) ) {
1089
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_RESERVE_CONTROLLER ) ) {
1090
1090
return C . ERR_NOT_IN_RANGE ;
1091
1091
}
1092
1092
if ( target . structureType != 'controller' ) {
@@ -1152,7 +1152,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
1152
1152
register . assertTargetObject ( target ) ;
1153
1153
return C . ERR_INVALID_TARGET ;
1154
1154
}
1155
- if ( ! target . pos . isNearTo ( this . pos ) ) {
1155
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_DISMANTLE ) ) {
1156
1156
return C . ERR_NOT_IN_RANGE ;
1157
1157
}
1158
1158
if ( this . room . controller && ! this . room . controller . my && this . room . controller . safeMode ) {
@@ -1183,7 +1183,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
1183
1183
register . assertTargetObject ( target ) ;
1184
1184
return C . ERR_INVALID_TARGET ;
1185
1185
}
1186
- if ( ! target . pos . isNearTo ( this . pos ) ) {
1186
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_GENERATE_SAFEMODE ) ) {
1187
1187
return C . ERR_NOT_IN_RANGE ;
1188
1188
}
1189
1189
@@ -1201,7 +1201,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
1201
1201
register . assertTargetObject ( target ) ;
1202
1202
return C . ERR_INVALID_TARGET ;
1203
1203
}
1204
- if ( ! target . pos . isNearTo ( this . pos ) ) {
1204
+ if ( ! target . pos . inRangeTo ( this . pos , C . RANGE_SIGN_CONTROLLER ) ) {
1205
1205
return C . ERR_NOT_IN_RANGE ;
1206
1206
}
1207
1207
if ( target . structureType != 'controller' ) {
0 commit comments