Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Classes/iNethackAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -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];
Expand All @@ -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 {
Expand Down
30 changes: 30 additions & 0 deletions Settings.bundle/advancedgameplay.plist
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,36 @@
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Deaf</string>
<key>Key</key>
<string>deaf</string>
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Pauper</string>
<key>Key</key>
<string>pauper</string>
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Allow Seduction</string>
<key>Key</key>
<string>seduce</string>
<key>DefaultValue</key>
<true/>
</dict>
</array>
</dict>
</plist>
3 changes: 1 addition & 2 deletions nethack/include/sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Loading