Fixed resource extraction
* Formula was mis-copied from the wiki, the result was multiplied by the provider's current quantity * Changed extraction per work unit from 1 to 10
This commit is contained in:
parent
b9bc5e038c
commit
44b6ec1920
3 changed files with 9 additions and 8 deletions
|
@ -66,8 +66,7 @@ public class ConstantsRegistrarBean
|
|||
defs.add( new ConstantDefinition( "game.resources.weightBase" , "Natural resources" , cDesc , 10.0 , 1.1 ,
|
||||
100.0 ) );
|
||||
cDesc = "Resources extracted per work unit, per (real) day, from a full provider with minimal difficulty.";
|
||||
defs.add( new ConstantDefinition( "game.resources.extraction" , "Natural resources" , cDesc , 1.0 , 1.0 ,
|
||||
true ) );
|
||||
defs.add( new ConstantDefinition( "game.resources.extraction" , "Natural resources" , cDesc , 10.0 , 1.0 , true ) );
|
||||
|
||||
// Happiness
|
||||
String[] hcNames = {
|
||||
|
|
|
@ -209,7 +209,7 @@ DECLARE
|
|||
|
||||
BEGIN
|
||||
|
||||
_extraction := _input.quantity * verse.get_extraction_factor(
|
||||
_extraction := verse.get_extraction_factor(
|
||||
_input.quantity / _input.quantity_max ,
|
||||
_input.difficulty );
|
||||
_allocation := _input.weight / _input.total_weight;
|
||||
|
@ -219,7 +219,9 @@ BEGIN
|
|||
* sys.get_constant( 'game.resources.extraction' )
|
||||
/ 1440.0; -- FIXME: hardcoded!
|
||||
|
||||
RAISE NOTICE 'Extraction % , allocation % , production %' , _extraction , _allocation , _production;
|
||||
PERFORM sys.write_sql_log( 'MiningUpdate' , 'TRACE' , 'Resource #' || _input.resource
|
||||
|| ' @ planet #' || _input.planet || ': extraction ' || _extraction
|
||||
|| ', allocation ' || _allocation || ', production ' || _production );
|
||||
_quantity := _allocation * _production * _extraction;
|
||||
IF _quantity > _input.quantity THEN
|
||||
_quantity := _input.quantity;
|
||||
|
|
|
@ -60,12 +60,12 @@ BEGIN;
|
|||
) );
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_update_resource( ) - Provider udpated' );
|
||||
SELECT is( resprov_quantity , 999.0::DOUBLE PRECISION )
|
||||
SELECT is( resprov_quantity , 999.999::DOUBLE PRECISION )
|
||||
FROM verse.resource_providers
|
||||
WHERE planet_id = 1 AND resource_name_id = 1;
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_update_resource( ) - Planet resources income udpated' );
|
||||
SELECT is( pres_income , 1.0::DOUBLE PRECISION )
|
||||
SELECT is( pres_income , 0.001::DOUBLE PRECISION )
|
||||
FROM verse.planet_resources
|
||||
WHERE planet_id = 1 AND resource_name_id = 1;
|
||||
|
||||
|
@ -78,12 +78,12 @@ BEGIN;
|
|||
) );
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_update_resource( ) - Bounded extraction quantity (1/2)' );
|
||||
SELECT is( resprov_quantity , 0.0::DOUBLE PRECISION )
|
||||
SELECT is( resprov_quantity , 990.0::DOUBLE PRECISION )
|
||||
FROM verse.resource_providers
|
||||
WHERE planet_id = 1 AND resource_name_id = 1;
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_update_resource( ) - Bounded extraction quantity (2/2)' );
|
||||
SELECT is( pres_income , 1000.0::DOUBLE PRECISION )
|
||||
SELECT is( pres_income , 10.0::DOUBLE PRECISION )
|
||||
FROM verse.planet_resources
|
||||
WHERE planet_id = 1 AND resource_name_id = 1;
|
||||
|
||||
|
|
Reference in a new issue