diff --git a/Classes/iNethackAppDelegate.m b/Classes/iNethackAppDelegate.m index d22c4f68..1fbed34d 100644 --- a/Classes/iNethackAppDelegate.m +++ b/Classes/iNethackAppDelegate.m @@ -39,6 +39,9 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; BOOL startAsBlind = [defaults boolForKey:@"blind"]; BOOL startAsNudist = [defaults boolForKey:@"nudist"]; + BOOL startAsDeaf = [defaults boolForKey:@"deaf"]; + BOOL startAsPauper = [defaults boolForKey:@"pauper"]; + BOOL allowSeduction = [defaults boolForKey:@"seduce"]; NSString *petType = [defaults stringForKey:@"pettype"]; NSString *dogName = [defaults stringForKey:@"dogname"]; NSString *catName = [defaults stringForKey:@"catname"]; @@ -51,6 +54,12 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { if (startAsNudist) { [activeOptions addObject:@"nudist"]; } + if (startAsDeaf) { + [activeOptions addObject:@"deaf"]; + } + if (startAsPauper) { + [activeOptions addObject:@"pauper"]; + } if (petType && [petType length] > 0 && ![petType isEqualToString:@"random"]) { NSString *petOption = [NSString stringWithFormat:@"pettype:%@", petType]; [activeOptions addObject:petOption]; @@ -67,7 +76,12 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { NSString *horseOption = [NSString stringWithFormat:@"horsename:%@", horseName]; [activeOptions addObject:horseOption]; } - if ([activeOptions count] > 0) { + if (!allowSeduction) { + // Seduction is on by default, but it can be turned off with SEDUCE=0 + [activeOptions addObject:@"SEDUCE=0"]; + } + + if ([activeOptions count] > 0) { NSString *optionsString = [activeOptions componentsJoinedByString:@","]; setenv("NETHACKOPTIONS", [optionsString UTF8String], 1); } else { diff --git a/Settings.bundle/advancedgameplay.plist b/Settings.bundle/advancedgameplay.plist index fa462f1e..8aafdae7 100644 --- a/Settings.bundle/advancedgameplay.plist +++ b/Settings.bundle/advancedgameplay.plist @@ -49,6 +49,36 @@ DefaultValue + + Type + PSToggleSwitchSpecifier + Title + Deaf + Key + deaf + DefaultValue + + + + Type + PSToggleSwitchSpecifier + Title + Pauper + Key + pauper + DefaultValue + + + + Type + PSToggleSwitchSpecifier + Title + Allow Seduction + Key + seduce + DefaultValue + + diff --git a/nethack/include/sys.h b/nethack/include/sys.h index 8b823b0d..ed2f5785 100644 --- a/nethack/include/sys.h +++ b/nethack/include/sys.h @@ -51,7 +51,6 @@ struct sysopt { extern struct sysopt sysopt; -// iNethack2: enable seduce. -#define SYSOPT_SEDUCE 1 +#define SYSOPT_SEDUCE sysopt.seduce #endif /* SYS_H */