weaponRecoveryTime (for shaders, mimics 1.76 laserHeatLevel behaviour for NPCs)

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5003 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Chris Morris 2012-06-11 19:17:30 +00:00
parent 7d8b4ff4c4
commit 48e2a103bb
3 changed files with 10 additions and 1 deletions

View File

@ -384,6 +384,7 @@
"maxFlightSpeed", "maxFlightSpeed",
"speedFactor", "speedFactor",
"damage", "damage",
"weaponRecoveryTime",
"laserHeatLevel", "laserHeatLevel",
"hullHeatLevel", "hullHeatLevel",
"entityPersonality", "entityPersonality",

View File

@ -873,6 +873,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
- (NSComparisonResult) compareBeaconCodeWith:(ShipEntity *)other; - (NSComparisonResult) compareBeaconCodeWith:(ShipEntity *)other;
- (GLfloat)weaponRecoveryTime;
- (GLfloat)laserHeatLevel; - (GLfloat)laserHeatLevel;
- (GLfloat)hullHeatLevel; - (GLfloat)hullHeatLevel;
- (GLfloat)entityPersonality; - (GLfloat)entityPersonality;

View File

@ -7830,9 +7830,16 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
} }
// for shaders, equivalent to 1.76's NPC laserHeatLevel
- (GLfloat) weaponRecoveryTime
{
float result = (weapon_recharge_rate - [self shotTime]) / weapon_recharge_rate;
return OOClamp_0_1_f(result);
}
- (GLfloat)laserHeatLevel - (GLfloat)laserHeatLevel
{ {
// float result = (weapon_recharge_rate - [self shotTime]) / weapon_recharge_rate;
float result = weapon_temp / NPC_MAX_WEAPON_TEMP; float result = weapon_temp / NPC_MAX_WEAPON_TEMP;
return OOClamp_0_1_f(result); return OOClamp_0_1_f(result);
} }