Adjust some odds usage
This commit is contained in:
parent
fe5cef097f
commit
1bc115810a
@ -67,8 +67,15 @@ this.aiStarted = function() {
|
||||
{
|
||||
condition: ai.conditionScannerContainsHuntableOffender,
|
||||
configuration: ai.configurationAcquireScannedTarget,
|
||||
behaviour: ai.behaviourDestroyCurrentTarget,
|
||||
reconsider: 1
|
||||
truebranch: [
|
||||
/* if we require bounty hunters to have actual *good*
|
||||
* odds they'll never shoot anything */
|
||||
{
|
||||
notcondition: ai.conditionCombatOddsBad,
|
||||
behaviour: ai.behaviourDestroyCurrentTarget,
|
||||
reconsider: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
/* What about loot? */
|
||||
{
|
||||
|
@ -32,7 +32,8 @@ this.version = "1.79";
|
||||
this.aiStarted = function() {
|
||||
var ai = new worldScripts["oolite-libPriorityAI"].AILib(this.ship);
|
||||
|
||||
ai.setCommunicationsRole("pirate");
|
||||
ai.setCommunicationsRole("_constrictor");
|
||||
ai.setParameter("oolite_flag_surrendersLate",true);
|
||||
|
||||
ai.setPriorities([
|
||||
/* Fight */
|
||||
@ -46,7 +47,7 @@ this.aiStarted = function() {
|
||||
},
|
||||
condition: ai.conditionLosingCombat,
|
||||
behaviour: ai.behaviourFleeCombat,
|
||||
reconsider: 5
|
||||
reconsider: 20
|
||||
},
|
||||
{
|
||||
condition: ai.conditionInCombat,
|
||||
|
@ -81,7 +81,7 @@ this.aiStarted = function() {
|
||||
reconsider: 1
|
||||
},
|
||||
{
|
||||
condition: ai.conditionScannerContainsHuntableOffender,
|
||||
condition: ai.conditionScannerContainsSeriousOffender,
|
||||
configuration: ai.configurationAcquireScannedTarget,
|
||||
behaviour: ai.behaviourDestroyCurrentTarget,
|
||||
reconsider: 1
|
||||
|
@ -33,6 +33,7 @@ this.aiStarted = function() {
|
||||
var ai = new worldScripts["oolite-libPriorityAI"].AILib(this.ship);
|
||||
|
||||
ai.setParameter("oolite_flag_sendsDistressCalls",true);
|
||||
ai.setParameter("oolite_flag_surrendersEarly",true);
|
||||
|
||||
ai.setCommunicationsRole("trader");
|
||||
|
||||
|
@ -732,13 +732,27 @@ AILib.prototype.conditionCascadeDetected = function()
|
||||
|
||||
AILib.prototype.conditionCombatOddsTerrible = function()
|
||||
{
|
||||
return this.oddsAssessment() < 0.375;
|
||||
if (this.getParameter("oolite_flag_surrendersEarly"))
|
||||
{
|
||||
return this.oddsAssessment() < 0.75;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.oddsAssessment() < 0.375;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AILib.prototype.conditionCombatOddsBad = function()
|
||||
{
|
||||
return this.oddsAssessment() < 0.75;
|
||||
if (this.getParameter("oolite_flag_surrendersLate"))
|
||||
{
|
||||
return this.oddsAssessment() < 0.375;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.oddsAssessment() < 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1342,6 +1356,15 @@ AILib.prototype.conditionScannerContainsFugitive = function()
|
||||
}
|
||||
|
||||
AILib.prototype.conditionScannerContainsHuntableOffender = function()
|
||||
{
|
||||
return this.checkScannerWithPredicate(function(s) {
|
||||
var threshold = this.fineThreshold() / 2;
|
||||
return s.isInSpace && s.bounty > threshold && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
AILib.prototype.conditionScannerContainsSeriousOffender = function()
|
||||
{
|
||||
return this.checkScannerWithPredicate(function(s) {
|
||||
var threshold = this.fineThreshold();
|
||||
|
Loading…
x
Reference in New Issue
Block a user