Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong messages are printed in DarkToDark #21

Open
heasm66 opened this issue Aug 18, 2022 · 0 comments
Open

Wrong messages are printed in DarkToDark #21

heasm66 opened this issue Aug 18, 2022 · 0 comments

Comments

@heasm66
Copy link

heasm66 commented Aug 18, 2022

DarkToDark always prints the first message because when you are in the “Darkness” the game_section is set to that object and the “Darkness” object doesn’t have a section property. This will mean that whenever you stumble around in the dark you will always die with the first message - “death by bear”.

There is also a check against an object number that needs to be rewritten more robust:

  DarkToDark and location >= 123
	HRoom   Dark_Shaft "Dark Shaft"  
	HRoom   Dark_Passage "Dark Passage"      
	HRoom   Cellars "Cellars"        
	HRoom   Wine_Cellars "Wine Cellars"      
	HRoom   Cellars_South "Cellars South"    
	HRoom   Cellar_West "Cellar West"        
	HRoom   Infinity_Symbol "Infinity Symbol"        
	HRoom   Sandstone_Passage "Sandstone Passage"    
	HRoom   The_Octagon "The Octagon"        
	HRoom   White_Hallway "White Hallway"    
	HRoom   Halfway_up_the_Stairs "Halfway up the Stairs"  

Chimney should also inherit from the class HRoom.
HRoom Chimney "Chimney"

New logic for DarkToDark:

[ DarkToDark ;
	deadflag = DIED;
	if( real_location.section ~= T_MODERN ) {
		"As you step falteringly through the darkness, the air falls ice-cold, whispering in secret languages. 
		 Suddenly a great bear rears up before you, savagely sweeping its paw!";
	}
	deadflag = FAILED;
	print "As you unwisely blunder about in the dark, you ";
	if( real_location == Priests_Hole || real_location == Chimney )
		"slip down a side passage of the chimney, further and further, blindly landing in a cloud of soot in the 
		 fireplace of the lounge downstairs. Fortunately your family is on hand to clean you up and put you back
		 to work packing.";
! r18 Made a more robust version that isn't dependent on object ordering
	if( real_location == Dark_Shaft || real_location == Dark_Passage || real_location == Cellars ||
		real_location == Wine_Cellars || real_location == Cellars_South || real_location == Cellar_West || 
		real_location == Infinity_Symbol || real_location == Sandstone_Passage || 
		real_location == The_Octagon || real_location == White_Hallway ) 
		"miss your footing, trip over and bang your head... Some time later you wake up in hospital, 
		 very confused and not on holiday. Fortunately Aunt Jemima comes to visit you every afternoon with plenty
		 of things for you to do...";
	"put a foot wrong and crash through a thin plaster roof into one of the upstairs bedrooms, happily landing 
	 on the bed. In later years it becomes a family joke that you demolished half the house for a tatty old
	 tourist map.";
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant