Remove Strict Mode

Replace strict mode control with OXP enable/disable control
Display OXP setting on new game ship parade to make it clearer to users why their OXPs aren't loading
Adjust descriptions
Remove all gameplay differences other than OXP loading in strict mode
This commit is contained in:
cim 2013-06-29 10:21:35 +01:00
parent 52f953f7b0
commit 848e59ce19
12 changed files with 138 additions and 270 deletions

View File

@ -1073,8 +1073,8 @@
"options-begin-new-game" = " Begin New Game ";
"options-game-options" = " Game Options… ";
"options-exit-game" = " Exit Game ";
"options-reset-to-unrestricted-play" = " Reset to Unrestricted Play ";
"options-reset-to-strict-play" = " Reset to Strict Play ";
"options-reset-to-unrestricted-play" = " Reset and enable OXPs ";
"options-reset-to-strict-play" = " Reset and disable OXPs ";
// Gameoptions screen
"gameoptions-autosave-yes" = " Autosave: On ";
@ -1269,7 +1269,7 @@
"loadfailed-no-file-specified" = "No file specified.";
"loadfailed-could-not-load-file" = "Could not load file.";
"loadfailed-could-not-use-ship-type-@-please-switch-to-unrestricted"
= "Unable to use ship type “%@” in strict mode - please switch to unrestricted mode first.";
= "Unable to use ship type “%@” when OXPs are disabled. Please re-enable OXPs";
"loadfailed-could-not-find-ship-type-@-please-reinstall-the-appropriate-OXP"
= "Could not find ship type “%@” - please reinstall the appropriate OXP.";
"loadfailed-invalid-saved-game-no-ship-specified"
@ -1303,8 +1303,8 @@
"no-target-string" = "No target";
"communications-log-string" = "Communications Log";
"adjusting-word" = " (adjusting)";
"strict-play-enabled" = "Strict Play Enabled";
"unrestricted-play-enabled" = "Unrestricted Play Enabled";
"strict-play-enabled" = "OXP loading disabled";
"unrestricted-play-enabled" = "OXP loading enabled";
"human-word" = "human"; // Important only lower case characters here!
"human-colonial-description%0" = "Human Colonial";
"human-colonial-description%1" = "Human Colonials";

View File

@ -908,10 +908,8 @@ static GLfloat sBaseMass = 0.0;
if ([dict oo_boolForKey:@"has_ecm"]) [equipment oo_setBool:YES forKey:@"EQ_ECM"];
if ([dict oo_boolForKey:@"has_scoop"]) [equipment oo_setBool:YES forKey:@"EQ_FUEL_SCOOPS"];
if ([dict oo_boolForKey:@"has_energy_bomb"]) [equipment oo_setBool:YES forKey:@"EQ_ENERGY_BOMB"];
if (!strict)
{
if ([dict oo_boolForKey:@"has_fuel_injection"]) [equipment oo_setBool:YES forKey:@"EQ_FUEL_INJECTION"];
}
if ([dict oo_boolForKey:@"has_fuel_injection"]) [equipment oo_setBool:YES forKey:@"EQ_FUEL_INJECTION"];
// Legacy energy unit type -> energy unit equipment item
if ([dict oo_boolForKey:@"has_energy_unit"] && [self installedEnergyUnitType] == ENERGY_UNIT_NONE)
@ -933,7 +931,7 @@ static GLfloat sBaseMass = 0.0;
}
}
/* Energy bombs are no longer supported in non-strict mode. As compensation,
/* Energy bombs are no longer supported without OXPs. As compensation,
we'll award either a Q-mine or some cash. We can't determine what to
award until we've handled missiles later on, though.
*/
@ -972,28 +970,15 @@ static GLfloat sBaseMass = 0.0;
[contracts release];
[contract_record release];
// Don't load passengers & contracts in strict mode savegames!
if ([UNIVERSE strict])
{
max_passengers = 0;
passengers = nil;
passenger_record = nil;
contracts = nil;
contract_record = nil;
parcels = nil;
parcel_record = nil;
}
else
{
max_passengers = [dict oo_intForKey:@"max_passengers" defaultValue:0];
passengers = [[dict oo_arrayForKey:@"passengers"] mutableCopy];
passenger_record = [[dict oo_dictionaryForKey:@"passenger_record"] mutableCopy];
contracts = [[dict oo_arrayForKey:@"contracts"] mutableCopy];
contract_record = [[dict oo_dictionaryForKey:@"contract_record"] mutableCopy];
parcels = [[dict oo_arrayForKey:@"parcels"] mutableCopy];
parcel_record = [[dict oo_dictionaryForKey:@"parcel_record"] mutableCopy];
max_passengers = [dict oo_intForKey:@"max_passengers" defaultValue:0];
passengers = [[dict oo_arrayForKey:@"passengers"] mutableCopy];
passenger_record = [[dict oo_dictionaryForKey:@"passenger_record"] mutableCopy];
contracts = [[dict oo_arrayForKey:@"contracts"] mutableCopy];
contract_record = [[dict oo_dictionaryForKey:@"contract_record"] mutableCopy];
parcels = [[dict oo_arrayForKey:@"parcels"] mutableCopy];
parcel_record = [[dict oo_dictionaryForKey:@"parcel_record"] mutableCopy];
}
if (passengers == nil) passengers = [[NSMutableArray alloc] init];
if (passenger_record == nil) passenger_record = [[NSMutableDictionary alloc] init];
@ -2642,14 +2627,6 @@ static GLfloat sBaseMass = 0.0;
else velocity = vector_multiply_scalar(velocity, velmag2 / velmag);
}
if ([UNIVERSE strict])
{
if (velmag2 < OG_ELITE_FORWARD_DRIFT)
{
// add acceleration
velocity = vector_add(velocity, vector_multiply_scalar(v_forward, (float)delta_t * OG_ELITE_FORWARD_DRIFT * 20.0f));
}
}
UPDATE_STAGE(@"updating joystick");
[self applyRoll:(float)delta_t*flightRoll andClimb:(float)delta_t*flightPitch];
@ -4982,20 +4959,17 @@ static GLfloat sBaseMass = 0.0;
[self markAsOffender:64 withReason:kOOLegalStatusReasonAttackedPolice];
}
if (![UNIVERSE strict]) // only mess with the scores if we're not in 'strict' mode
BOOL killIsCargo = ((killClass == CLASS_CARGO) && ([other commodityAmount] > 0) && ![other isHulk]);
if ((killIsCargo) || (killClass == CLASS_BUOY) || (killClass == CLASS_ROCK))
{
BOOL killIsCargo = ((killClass == CLASS_CARGO) && ([other commodityAmount] > 0) && ![other isHulk]);
if ((killIsCargo) || (killClass == CLASS_BUOY) || (killClass == CLASS_ROCK))
// EMMSTRAN: no killaward (but full bounty) for tharglets?
if (![other hasRole:@"tharglet"]) // okay, we'll count tharglets as proper kills
{
// EMMSTRAN: no killaward (but full bounty) for tharglets?
if (![other hasRole:@"tharglet"]) // okay, we'll count tharglets as proper kills
{
score /= 10; // reduce bounty awarded
killAward = NO; // don't award a kill
}
score /= 10; // reduce bounty awarded
killAward = NO; // don't award a kill
}
}
credits += score;
if (score > 9)
@ -5088,30 +5062,20 @@ static GLfloat sBaseMass = 0.0;
[self setScriptTarget:self];
[UNIVERSE clearPreviousMessage];
[self removeEquipmentItem:system_key];
if (![UNIVERSE strict])
{
NSString *damagedKey = [NSString stringWithFormat:@"%@_DAMAGED", system_key];
[self addEquipmentItem:damagedKey withValidation: NO inContext:@"damage"]; // for possible future repair.
[self doScriptEvent:OOJSID("equipmentDamaged") withArgument:system_key];
NSString *damagedKey = [NSString stringWithFormat:@"%@_DAMAGED", system_key];
[self addEquipmentItem:damagedKey withValidation: NO inContext:@"damage"]; // for possible future repair.
[self doScriptEvent:OOJSID("equipmentDamaged") withArgument:system_key];
if (![self hasEquipmentItem:system_name] && [self hasEquipmentItem:damagedKey])
{
/*
Display "foo damaged" message only if no script has
repaired or removed the equipment item. (If a script does
either of those and wants a message, it can write it
itself.)
*/
[UNIVERSE addMessage:[NSString stringWithFormat:DESC(@"@-damaged"), system_name] forCount:4.5];
}
}
else
if (![self hasEquipmentItem:system_name] && [self hasEquipmentItem:damagedKey])
{
[self doScriptEvent:OOJSID("equipmentDestroyed") withArgument:system_key];
if (![self hasEquipmentItem:system_name]) // Because script may have undestroyed it
{
[UNIVERSE addMessage:[NSString stringWithFormat:DESC(@"@-destroyed"), system_name] forCount:4.5];
}
/*
Display "foo damaged" message only if no script has
repaired or removed the equipment item. (If a script does
either of those and wants a message, it can write it
itself.)
*/
[UNIVERSE addMessage:[NSString stringWithFormat:DESC(@"@-damaged"), system_name] forCount:4.5];
}
// if Docking Computers have been selected to take damage and they happen to be on, switch them off
@ -5284,7 +5248,7 @@ static GLfloat sBaseMass = 0.0;
// Did we fail to observe traffic control regulations? However, due to the state of emergency,
// apply no unauthorized docking penalties if a nova is ongoing.
if (![UNIVERSE strict] && [dockedStation requiresDockingClearance] &&
if ([dockedStation requiresDockingClearance] &&
![self clearedToDock] && ![[UNIVERSE sun] willGoNova])
{
[self penaltyForUnauthorizedDocking];
@ -5984,7 +5948,7 @@ static GLfloat sBaseMass = 0.0;
{
[quip addObject:[NSArray arrayWithObjects:[eqType name], [NSNumber numberWithBool:YES], nil]];
}
else if (![UNIVERSE strict])
else
{
// Check for damaged version
if ([self hasEquipmentItem:[[eqType identifier] stringByAppendingString:@"_DAMAGED"]])
@ -6901,7 +6865,7 @@ static NSString *last_outfitting_key=nil;
if (minTechLevel != 0 && [self hasEquipmentItem:[eqType damagedIdentifier]]) minTechLevel--;
// reduce the minimum techlevel occasionally as a bonus..
if (![UNIVERSE strict] && techlevel < minTechLevel && techlevel + 3 > minTechLevel)
if (techlevel < minTechLevel && techlevel + 3 > minTechLevel)
{
unsigned day = i * 13 + (unsigned)floor([UNIVERSE getTime] / 86400.0);
unsigned char dayRnd = (day & 0xff) ^ system_seed.a;
@ -7486,6 +7450,7 @@ static NSString *last_outfitting_key=nil;
}
else
{
[gui setText:([UNIVERSE strict])? DESC(@"strict-play-enabled"):DESC(@"unrestricted-play-enabled") forRow:1 align:GUI_ALIGN_CENTER];
text = DESC(@"press-space-commander");
[gui setText:text forRow:21 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:21];
@ -9461,19 +9426,17 @@ static NSString *last_outfitting_key=nil;
#if MASS_DEPENDENT_FUEL_PRICES
- (GLfloat) fuelChargeRate
{
GLfloat rate = 1.0; // Standard (& strict play) charge rate.
GLfloat rate = 1.0; // Standard charge rate.
if (![UNIVERSE strict])
rate = [super fuelChargeRate];
// Experimental: the state of repair affects the fuel charge rate - more fuel needed for jumps, etc...
if (EXPECT(ship_trade_in_factor <= 90 && ship_trade_in_factor >= 75))
{
rate = [super fuelChargeRate];
// Experimental: the state of repair affects the fuel charge rate - more fuel needed for jumps, etc...
if (EXPECT(ship_trade_in_factor <= 90 && ship_trade_in_factor >= 75))
{
rate *= 2.0 - (ship_trade_in_factor / 100); // between 1.1x and 1.25x
//OOLog(@"fuelPrices", @"\"%@\" - repair status: %d%%, adjusted rate to:%.2f)", [self shipDataKey], ship_trade_in_factor, rate);
}
rate *= 2.0 - (ship_trade_in_factor / 100); // between 1.1x and 1.25x
//OOLog(@"fuelPrices", @"\"%@\" - repair status: %d%%, adjusted rate to:%.2f)", [self shipDataKey], ship_trade_in_factor, rate);
}
return rate;
}
#endif
@ -9599,7 +9562,7 @@ else _dockTarget = NO_TARGET;
OOCreditsQuantity calculatedFine = credits * 0.05;
OOCreditsQuantity maximumFine = 50000ULL;
if ([UNIVERSE strict] || [self clearedToDock])
if ([self clearedToDock])
return;
amountToPay = MIN(maximumFine, calculatedFine);

View File

@ -62,8 +62,6 @@ static NSString * const kOOLogNoteShowShipyardModel = @"script.debug.note.showSh
- (NSString *) processEscapePods // removes pods from cargo bay and treats categories of characters carried
{
if ([UNIVERSE strict]) return @"";
unsigned i;
BOOL added_entry = NO; // to prevent empty lines for slaves and the rare empty report.
NSMutableString *result = [NSMutableString string];

View File

@ -896,8 +896,8 @@ static NSTimeInterval time_last_frame;
}
exceptionContext = @"weapons online toggle";
// weapons online / offline toggle '_' - non-strict mode only
if (([gameView isDown:key_weapons_online_toggle] || joyButtonState[BUTTON_WEAPONSONLINETOGGLE]) && ![UNIVERSE strict])
// weapons online / offline toggle '_'
if (([gameView isDown:key_weapons_online_toggle] || joyButtonState[BUTTON_WEAPONSONLINETOGGLE]))
{
if (!weaponsOnlineToggle_pressed)
{
@ -1149,7 +1149,7 @@ static NSTimeInterval time_last_frame;
// user defaults file.
if (([gameView isDown:key_launch_escapepod] || joyButtonState[BUTTON_ESCAPE]) && [self hasEscapePod])
{
BOOL goodToLaunch = [UNIVERSE strict] || [[NSUserDefaults standardUserDefaults] boolForKey:@"escape-pod-activation-immediate"];
BOOL goodToLaunch = [[NSUserDefaults standardUserDefaults] boolForKey:@"escape-pod-activation-immediate"];
static OOTimeDelta escapePodKeyResetTime;
if (!goodToLaunch)
@ -1225,8 +1225,8 @@ static NSTimeInterval time_last_frame;
}
exceptionContext = @"docking clearance request";
// docking clearance request 'L', not available in strict mode
if ([gameView isDown:key_docking_clearance_request] && ![UNIVERSE strict])
if ([gameView isDown:key_docking_clearance_request])
{
if (!docking_clearance_request_key_pressed)
{
@ -1631,7 +1631,7 @@ static NSTimeInterval time_last_frame;
}
case GUI_SCREEN_SHORT_RANGE_CHART:
show_info_flag = ([gameView isDown:key_map_info] && ![UNIVERSE strict]);
show_info_flag = ([gameView isDown:key_map_info]);
// If we have entered this screen with the injectors key pressed, make sure
// that injectors switch off when we release it - Nikos.
@ -1771,19 +1771,6 @@ static NSTimeInterval time_last_frame;
}
case GUI_SCREEN_SYSTEM_DATA:
/* if ([self status] == STATUS_DOCKED && dockedStation == [UNIVERSE station] && [gameView isDown:key_contract_info] && ![UNIVERSE strict] && [self hasHyperspaceMotor]) // '?' toggle between maps/info and contract screen
{
if (!queryPressed)
{
[self setGuiToContractsScreen];
if ((oldSelection >= (int)[gui selectableRange].location)&&(oldSelection < (int)[gui selectableRange].location + (int)[gui selectableRange].length))
[gui setSelectedRow:oldSelection];
[self setGuiToContractsScreen];
}
queryPressed = YES;
}
else
queryPressed = NO; */
break;
#if OO_USE_CUSTOM_LOAD_SAVE
@ -3070,60 +3057,58 @@ static NSTimeInterval time_last_frame;
}
}
if (![UNIVERSE strict])
yawing = NO;
// if we have roll on the mouse x-axis, then allow using the keyboard yaw keys
if (!mouse_control_on || (mouse_control_on && !mouse_x_axis_map_to_yaw))
{
yawing = NO;
// if we have roll on the mouse x-axis, then allow using the keyboard yaw keys
if (!mouse_control_on || (mouse_control_on && !mouse_x_axis_map_to_yaw))
if ([gameView isDown:key_yaw_left])
{
if ([gameView isDown:key_yaw_left])
{
keyboardYawOverride=YES;
if (flightYaw < 0.0) flightYaw = 0.0;
[self increase_flight_yaw:isCtrlDown ? flightArrowKeyPrecisionFactor*yaw_dampner*yaw_delta : delta_t*yaw_delta];
yawing = YES;
}
else if ([gameView isDown:key_yaw_right])
{
keyboardYawOverride=YES;
if (flightYaw > 0.0) flightYaw = 0.0;
[self decrease_flight_yaw:isCtrlDown ? flightArrowKeyPrecisionFactor*yaw_dampner*yaw_delta : delta_t*yaw_delta];
yawing = YES;
}
keyboardYawOverride=YES;
if (flightYaw < 0.0) flightYaw = 0.0;
[self increase_flight_yaw:isCtrlDown ? flightArrowKeyPrecisionFactor*yaw_dampner*yaw_delta : delta_t*yaw_delta];
yawing = YES;
}
if(((mouse_control_on && mouse_x_axis_map_to_yaw) || numSticks) && !keyboardYawOverride)
else if ([gameView isDown:key_yaw_right])
{
// I think yaw is handled backwards in the code,
// which is why the negative sign is here.
stick_yaw = max_flight_yaw * (-reqYaw);
if (flightYaw < stick_yaw)
{
[self increase_flight_yaw:delta_t*yaw_delta];
if (flightYaw > stick_yaw)
flightYaw = stick_yaw;
}
if (flightYaw > stick_yaw)
{
[self decrease_flight_yaw:delta_t*yaw_delta];
if (flightYaw < stick_yaw)
flightYaw = stick_yaw;
}
yawing = (fabs(reqYaw) >= deadzone);
}
if (!yawing)
{
if (flightYaw > 0.0)
{
if (flightYaw > yaw_dampner) [self decrease_flight_yaw:yaw_dampner];
else flightYaw = 0.0;
}
if (flightYaw < 0.0)
{
if (flightYaw < -yaw_dampner) [self increase_flight_yaw:yaw_dampner];
else flightYaw = 0.0;
}
keyboardYawOverride=YES;
if (flightYaw > 0.0) flightYaw = 0.0;
[self decrease_flight_yaw:isCtrlDown ? flightArrowKeyPrecisionFactor*yaw_dampner*yaw_delta : delta_t*yaw_delta];
yawing = YES;
}
}
if(((mouse_control_on && mouse_x_axis_map_to_yaw) || numSticks) && !keyboardYawOverride)
{
// I think yaw is handled backwards in the code,
// which is why the negative sign is here.
stick_yaw = max_flight_yaw * (-reqYaw);
if (flightYaw < stick_yaw)
{
[self increase_flight_yaw:delta_t*yaw_delta];
if (flightYaw > stick_yaw)
flightYaw = stick_yaw;
}
if (flightYaw > stick_yaw)
{
[self decrease_flight_yaw:delta_t*yaw_delta];
if (flightYaw < stick_yaw)
flightYaw = stick_yaw;
}
yawing = (fabs(reqYaw) >= deadzone);
}
if (!yawing)
{
if (flightYaw > 0.0)
{
if (flightYaw > yaw_dampner) [self decrease_flight_yaw:yaw_dampner];
else flightYaw = 0.0;
}
if (flightYaw < 0.0)
{
if (flightYaw < -yaw_dampner) [self increase_flight_yaw:yaw_dampner];
else flightYaw = 0.0;
}
}
}
@ -3148,7 +3133,7 @@ static NSTimeInterval time_last_frame;
if (!switching_status_screens)
{
switching_status_screens = YES;
if ((gui_screen == GUI_SCREEN_STATUS)&&(![UNIVERSE strict]))
if (gui_screen == GUI_SCREEN_STATUS)
{
[self noteGUIWillChangeTo:GUI_SCREEN_MANIFEST];
[self setGuiToManifestScreen];
@ -3230,7 +3215,7 @@ static NSTimeInterval time_last_frame;
switching_equipship_screens = NO;
}
if ((([gameView isDown:gvFunctionKey4])||(fKeyAlias && [gameView isDown:gvNumberKey4])) && ![UNIVERSE strict])
if (([gameView isDown:gvFunctionKey4])||(fKeyAlias && [gameView isDown:gvNumberKey4]))
{
[self setGuiToInterfacesScreen:0];
[gui setSelectedRow:GUI_ROW_INTERFACES_START];
@ -3238,45 +3223,19 @@ static NSTimeInterval time_last_frame;
if (([gameView isDown:gvFunctionKey8])||(fKeyAlias && [gameView isDown:gvNumberKey8]))
{
/* if (!switching_market_screens)
{
if ((gui_screen == GUI_SCREEN_MARKET)&&(dockedStation == [UNIVERSE station])&&(![UNIVERSE strict] && [self hasHyperspaceMotor]))
{
[gameView clearKeys];
[self setGuiToContractsScreen];
[gui setSelectedRow:GUI_ROW_PASSENGERS_START];
}
else
{ */
[gameView clearKeys];
[self noteGUIWillChangeTo:GUI_SCREEN_MARKET];
[self setGuiToMarketScreen];
[gui setSelectedRow:GUI_ROW_MARKET_START];
/* }
}
switching_market_screens = YES;
}
else
{
switching_market_screens = NO;
*/
[gameView clearKeys];
[self noteGUIWillChangeTo:GUI_SCREEN_MARKET];
[self setGuiToMarketScreen];
[gui setSelectedRow:GUI_ROW_MARKET_START];
}
}
else
{
if (([gameView isDown:gvFunctionKey8])||(fKeyAlias && [gameView isDown:gvNumberKey8]))
{
/* if (!switching_market_screens)
{ */
[self noteGUIWillChangeTo:GUI_SCREEN_MARKET];
[self setGuiToMarketScreen];
[gui setSelectedRow:GUI_ROW_MARKET_START];
/* }
switching_market_screens = YES;
}
else
{
switching_market_screens = NO; */
[self noteGUIWillChangeTo:GUI_SCREEN_MARKET];
[self setGuiToMarketScreen];
[gui setSelectedRow:GUI_ROW_MARKET_START];
}
}
}

View File

@ -1016,7 +1016,14 @@ NSComparisonResult sortCommanders(id cdr1, id cdr2, void *context)
{
[self showShipyardModel:@"oolite-unknown-ship" shipData:nil personality:personality];
shipName = [cdr oo_stringForKey:@"ship_name" defaultValue:@"unknown"];
shipName = [shipName stringByAppendingString:@" - OXP not installed"];
if ([UNIVERSE strict])
{
shipName = [shipName stringByAppendingString:@" - OXPs disabled"];
}
else
{
shipName = [shipName stringByAppendingString:@" - OXP not installed"];
}
}
// Make a short description of the commander

View File

@ -317,15 +317,14 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
[self addEquipmentItem:@"EQ_QC_MINE" inContext:@"npc"];
}
}
if (![UNIVERSE strict])
{
// These items are not available in strict mode.
if ([shipDict oo_fuzzyBooleanForKey:@"has_fuel_injection"]) [self addEquipmentItem:@"EQ_FUEL_INJECTION" inContext:@"npc"];
if ([shipDict oo_fuzzyBooleanForKey:@"has_fuel_injection"]) [self addEquipmentItem:@"EQ_FUEL_INJECTION" inContext:@"npc"];
#if USEMASC
if ([shipDict oo_fuzzyBooleanForKey:@"has_military_jammer"]) [self addEquipmentItem:@"EQ_MILITARY_JAMMER" inContext:@"npc"];
if ([shipDict oo_fuzzyBooleanForKey:@"has_military_scanner_filter"]) [self addEquipmentItem:@"EQ_MILITARY_SCANNER_FILTER" inContext:@"npc"];
if ([shipDict oo_fuzzyBooleanForKey:@"has_military_jammer"]) [self addEquipmentItem:@"EQ_MILITARY_JAMMER" inContext:@"npc"];
if ([shipDict oo_fuzzyBooleanForKey:@"has_military_scanner_filter"]) [self addEquipmentItem:@"EQ_MILITARY_SCANNER_FILTER" inContext:@"npc"];
#endif
}
// can it be 'mined' for alloys?
canFragment = [shipDict oo_fuzzyBooleanForKey:@"fragment_chance" defaultValue:0.9];
@ -335,15 +334,8 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
max_cargo = [shipDict oo_unsignedIntForKey:@"max_cargo"];
extra_cargo = [shipDict oo_unsignedIntForKey:@"extra_cargo" defaultValue:15];
if (![UNIVERSE strict])
{
hyperspaceMotorSpinTime = [shipDict oo_floatForKey:@"hyperspace_motor_spin_time" defaultValue:DEFAULT_HYPERSPACE_SPIN_TIME];
if(![shipDict oo_boolForKey:@"hyperspace_motor" defaultValue:YES]) hyperspaceMotorSpinTime = -1;
}
else
{
hyperspaceMotorSpinTime = DEFAULT_HYPERSPACE_SPIN_TIME;
}
hyperspaceMotorSpinTime = [shipDict oo_floatForKey:@"hyperspace_motor_spin_time" defaultValue:DEFAULT_HYPERSPACE_SPIN_TIME];
if(![shipDict oo_boolForKey:@"hyperspace_motor" defaultValue:YES]) hyperspaceMotorSpinTime = -1;
[name autorelease];
name = [[shipDict oo_stringForKey:@"name" defaultValue:@"?"] copy];
@ -2825,7 +2817,7 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
for (eqTypeEnum = [eqTypes objectEnumerator]; (eqType = [eqTypeEnum nextObject]); )
{
// Equipment list, consistent with the rest of the API - Kaks
isDamaged = ![UNIVERSE strict] && [self hasEquipmentItem:[[eqType identifier] stringByAppendingString:@"_DAMAGED"]];
isDamaged = [self hasEquipmentItem:[[eqType identifier] stringByAppendingString:@"_DAMAGED"]];
if ([self hasEquipmentItem:[eqType identifier]] || isDamaged)
{
[quip addObject:eqType];
@ -3290,9 +3282,9 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
_missileRole = nil; // use generic ship fallback from now on.
}
// In unrestricted mode, assign random missiles 20% of the time without missile_role (or 10% with valid missile_role)
if (chance > 0.8f && ![UNIVERSE strict]) role = @"missile";
// otherwise use the standard role (100% of the time in restricted mode).
// assign random missiles 20% of the time without missile_role (or 10% with valid missile_role)
if (chance > 0.8f) role = @"missile";
// otherwise use the standard role
else role = @"EQ_MISSILE";
missileType = [self verifiedMissileTypeFromRole:role];
@ -7034,13 +7026,11 @@ NSComparisonResult ComparePlanetsBySurfaceDistance(id i1, id i2, void* context)
#if MASS_DEPENDENT_FUEL_PRICES
if (![UNIVERSE strict])
if (EXPECT(PLAYER != nil && mass> 0 && mass != [PLAYER baseMass]))
{
if (EXPECT(PLAYER != nil && mass> 0 && mass != [PLAYER baseMass]))
{
rate = calcFuelChargeRate(mass);
}
rate = calcFuelChargeRate(mass);
}
OOLog(@"fuelPrices", @"\"%@\" fuel charge rate: %.2f (mass ratio: %.2f/%.2f)", [self shipDataKey], rate, mass, [PLAYER baseMass]);
#endif

View File

@ -2263,8 +2263,6 @@ NSDictionary *OOMakeDockingInstructions(StationEntity *station, Vector coords, f
- (BOOL) hasShipyard
{
if ([UNIVERSE strict])
return NO;
if ([UNIVERSE station] == self)
return YES;
id determinant = [shipinfoDictionary objectForKey:@"has_shipyard"];

View File

@ -1834,7 +1834,7 @@ static OOTextureSprite *NewTextureSpriteWithDescriptor(NSDictionary *descriptor)
advancedNavArrayMode = OPTIMIZED_BY_TIME;
}
if (advancedNavArrayMode != OPTIMIZED_BY_NONE && ![UNIVERSE strict] && [player hasEquipmentItem:@"EQ_ADVANCED_NAVIGATIONAL_ARRAY"])
if (advancedNavArrayMode != OPTIMIZED_BY_NONE && [player hasEquipmentItem:@"EQ_ADVANCED_NAVIGATIONAL_ARRAY"])
{
OOSystemID planetNumber = [UNIVERSE findSystemNumberAtCoords:galaxy_coordinates withGalaxySeed:galaxy_seed];
OOSystemID destNumber = [UNIVERSE findSystemNumberAtCoords:cursor_coordinates withGalaxySeed:galaxy_seed];

View File

@ -203,12 +203,6 @@ static NSDictionary *sMissilesRegistry = nil;
extra = [info oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX];
if (extra != nil)
{
// Note: currently strict_mode_compatible is already handled by Universe, but at some point we want to get rid of Universe's equipmentData.
BOOL strictModeOnly = [extra oo_boolForKey:@"strict_mode_only" defaultValue:NO];
//BOOL strictModeCompatible = [extra oo_boolForKey:@"strict_mode_compatible" defaultValue:strictModeOnly]; // Wrong! Interprets explicitly set strict_mode_only = false as strict_mode_ompatible = false
BOOL strictModeCompatible = [extra oo_boolForKey:@"strict_mode_compatible" defaultValue:([extra objectForKey:@"strict_mode_only"] != nil)]; // if strict_mode_only is explicitely set, it's compatible with strict mode!
BOOL strict = [UNIVERSE strict];
if ((strict && !strictModeCompatible) || (!strict && strictModeOnly)) OK = NO;
_isAvailableToAll = [extra oo_boolForKey:@"available_to_all" defaultValue:_isAvailableToAll];
_isAvailableToPlayer = [extra oo_boolForKey:@"available_to_player" defaultValue:_isAvailableToPlayer];

View File

@ -546,9 +546,7 @@ static JSBool PlayerSetEscapePodDestination(JSContext *context, uintN argc, jsva
if ([UNIVERSE inInterstellarSpace])
{
// Set 3.5 ly as the limit, enough to reach at least 2 systems!
// In strict mode the max rescue distance in witchspace would be 2.33ly:
// 4.66 fuel to misjump there, 2.33 to fly back = 7ly fuel.
rescueRange = [UNIVERSE strict] ? MAX_JUMP_RANGE / 3.0 : MAX_JUMP_RANGE / 2.0;
rescueRange = MAX_JUMP_RANGE / 2.0;
}
NSMutableArray *sDests = [UNIVERSE nearbyDestinationsWithinRange:rescueRange];
NSUInteger i = 0, nDests = [sDests count];

View File

@ -2107,13 +2107,6 @@ static JSBool ShipSetEquipmentStatus(JSContext *context, uintN argc, jsval *vp)
GET_THIS_SHIP(thisEnt);
if (EXPECT_NOT([UNIVERSE strict]))
{
// It's OK to have a hard error here since only built-in scripts run in strict mode.
OOJSReportError(context, @"Cannot set equipment status while in strict mode.");
return NO;
}
if (argc < 2)
{
OOJSReportBadArguments(context, @"Ship", @"setEquipmentStatus", argc, OOJS_ARGV, nil, @"equipment type and status");

View File

@ -198,7 +198,6 @@ static OOComparisonResult comparePrice(id dict1, id dict2, void * context);
- (void) prunePreloadingPlanetMaterials;
#endif
- (void) filterOutNonStrictEquipment;
- (BOOL) reinitAndShowDemo:(BOOL) showDemo strictChanged:(BOOL) strictChanged;
// Set shader effects level without logging or triggering a reset -- should only be used directly during startup.
@ -466,6 +465,8 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
}
/* From 1.79, "strict mode" is "no OXPs mode" as a useful debug tool,
* nothing else */
- (BOOL) strict
{
return strict;
@ -2314,7 +2315,7 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
GLfloat startAngle = 0;
GLfloat aspectRatio = 1;
if (!strict && forDocking)
if (forDocking)
{
NSDictionary *info = [[PLAYER dockedStation] shipInfoDictionary];
sides = [info oo_unsignedIntForKey:@"tunnel_corners" defaultValue:4];
@ -2394,17 +2395,7 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
- (void) handleGameOver
{
// In unrestricted mode, reload last save game, if any. In strict mode, always restart as a fresh Jameson.
// NOTE: this is also called when loading a game fails, and when the js engine fails to reset properly.
if (![self strict] && [[self gameController] playerFileToLoad])
{
[[self gameController] loadPlayerIfRequired];
}
else
{
[self reinitAndShowDemo:NO];
}
[[self gameController] loadPlayerIfRequired];
}
@ -9493,33 +9484,11 @@ Entity *gOOJSPlayerIfStale = nil;
[equipmentData autorelease];
equipmentData = [[ResourceManager arrayFromFilesNamed:@"equipment.plist" inFolder:@"Config" andMerge:YES] retain];
if (strict) [self filterOutNonStrictEquipment];
[OOEquipmentType loadEquipment];
}
- (void) filterOutNonStrictEquipment
{
NSMutableArray *filteredEq = [NSMutableArray arrayWithCapacity:[equipmentData count]];
NSArray *eqDef = nil;
foreach (eqDef, equipmentData)
{
BOOL compatible = NO;
if ([eqDef count] > EQUIPMENT_EXTRA_INFO_INDEX)
{
NSDictionary *extra = [eqDef oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX];
compatible = [extra oo_boolForKey:@"strict_mode_compatible" defaultValue:([extra objectForKey:@"strict_mode_only"] != nil)];
}
if (compatible) [filteredEq addObject:eqDef];
}
[equipmentData release];
equipmentData = [filteredEq copy];
}
- (void) verifyEntitySessionIDs
{
#ifndef NDEBUG
@ -9625,7 +9594,6 @@ Entity *gOOJSPlayerIfStale = nil;
if(showDemo)
{
[player setGuiToIntroFirstGo:NO];
if (strictChanged) [gui setText:(strict)? DESC(@"strict-play-enabled"):DESC(@"unrestricted-play-enabled") forRow:1 align:GUI_ALIGN_CENTER];
[player setStatus:STATUS_START_GAME];
}
else