Adjustments to pirate demand size and threat assessment calculation
This commit is contained in:
parent
2fb4822833
commit
805ca6a238
@ -2918,6 +2918,12 @@ AILib.prototype.behaviourRobTarget = function()
|
||||
demand = (hascargo/20);
|
||||
demand = demand * (1+Math.random()+(8-system.info.government)/8);
|
||||
// between 5% and 15% of cargo
|
||||
if (this.conditionCombatOddsExcellent())
|
||||
{
|
||||
// if we have overwhelming force, can get away with demanding more
|
||||
demand *= 1.5+Math.random();
|
||||
// between 7.5% and 37.5% of cargo
|
||||
}
|
||||
demand = Math.ceil(demand); // round it up so there's always at least 1
|
||||
|
||||
var maxdemand = 0;
|
||||
|
@ -3493,15 +3493,16 @@ static JSBool ShipThreatAssessment(JSContext *context, uintN argc, jsval *vp)
|
||||
{
|
||||
assessment += 1 + ShipThreatAssessmentWeapon(wt);
|
||||
}
|
||||
// port and starboard weapons less important
|
||||
wt = [thisEnt weaponTypeIDForFacing:WEAPON_FACING_PORT];
|
||||
if (wt != WEAPON_NONE)
|
||||
{
|
||||
assessment += 0.2 + ShipThreatAssessmentWeapon(wt);
|
||||
assessment += 0.2 + ShipThreatAssessmentWeapon(wt)/5.0;
|
||||
}
|
||||
wt = [thisEnt weaponTypeIDForFacing:WEAPON_FACING_STARBOARD];
|
||||
if (wt != WEAPON_NONE)
|
||||
{
|
||||
assessment += 0.2 + ShipThreatAssessmentWeapon(wt);
|
||||
assessment += 0.2 + ShipThreatAssessmentWeapon(wt)/5.0;
|
||||
}
|
||||
|
||||
NSEnumerator *subEnum = [thisEnt shipSubEntityEnumerator];
|
||||
|
Loading…
x
Reference in New Issue
Block a user