(* Written by James A. Johnson the Beacon Deacon *)
PROGRAM WAR(INPUT, OUTPUT);
CONST   H1 = 'Iron helmet with grated mask';
	H2 = 'Helmet of Salvation';
	H3 = 'Gold helmet';
	H4 = 'Viking helmet';
	C1 = 'Chestplate of Righteousness';
        C2 = 'Chestplate of Bronze';
	C3 = 'Chestplate of Iron';
	C4 = 'Chestplate of Religion';
	W1 = 'Jeweled Belt';
	W2 = 'Leather Belt';
	W3 = 'Belt of Truth';
	W4 = 'Belt of Honor';
	F1 = 'Winged Shoes';
	F2 = 'Spiked Boots';
	F3 = 'Shoes of Swiftness';
	F4 = 'Shoes of Readiness';
 	S1 = 'Shield of Gold';
	S2 = 'Shield of Valor';
	S3 = 'Shield of Faith';
	S4 = 'Shield of Fervor';
	O1 = 'Sword of the Spirit';
	O2 = 'Magic sword';
	O3 = 'Double-edged sword';
	O4 = 'Single-edged sword';
        D1 = 'A bag of silver coins';
	D2 = 'A gold bar';
	D3 = 'A pouch of rubies';
  	D4 = 'Diamonds';

VAR
   SEEKER, HEAD, CHEST, WAIST, FEET, SHIELD, OFFENSE, DMG, CHOICE : INTEGER;
   RESP : CHAR;

PROCEDURE Armory(VAR Head, Chest, Waist, Feet, Shield, Offense, Dmg: INTEGER);
BEGIN
   WRITELN('1.  Helmet:  ');
   CASE Head OF 
        0 : WRITELN('NONE');
	1 : WRITELN(H1);
	2 : WRITELN(H2);
        3 : WRITELN(H3);
	4 : WRITELN(H4);
   END;
   WRITELN('2.  Chestplate:  ');
   CASE Chest OF 
        0 : WRITELN('NONE');
	1 : WRITELN(C1);
	2 : WRITELN(C2);
	3 : WRITELN(C3);
	4 : WRITELN(C4);
   END;
   WRITELN('3.  Waist Guard:  ');
   CASE Waist OF
	0 : WRITELN('NONE');
	1 : WRITELN(W1);
	2 : WRITELN(W2);
	3 : WRITELN(W3);
	4 : WRITELN(W4);
   END;
   WRITELN('4.  Footwear:  ');
   CASE Feet OF
	0 : WRITELN('NONE');
	1 : WRITELN(F1);
   	2 : WRITELN(F2);
	3 : WRITELN(F3);
	4 : WRITELN(F4);
   END;
   WRITELN('5.  Shield:  ');
   CASE Shield OF
	0 : WRITELN('NONE');
	1 : WRITELN(S1);
	2 : WRITELN(S2);
	3 : WRITELN(S3);
	4 : WRITELN(S4);
   END;
   WRITELN('6.  Sword:  ');
   CASE Offense OF
	0 : WRITELN('NONE');
	1 : WRITELN(O1);
	2 : WRITELN(O2);
	3 : WRITELN(O3);
	4 : WRITELN(O4);
   END;
   WRITELN('7.  Treasure:  ');
   CASE Dmg OF 
	0 :WRITELN('NONE');
        1 : WRITELN(d1);
	2 : WRITELN(d2);
	3 : WRITELN(d3);
	4 : WRITELN(d4);
   END;
   WRITELN;
END;
	  
PROCEDURE Pause;
VAR I:INTEGER;
BEGIN
   WRITELN;
   WRITELN('Press RETURN/ENTER to Continue.');
   READLN;
   FOR I:=1 TO 36 DO WRITELN;
END;

PROCEDURE Getter(VAR Item,Head,Chest,Waist,Feet,Shield,Offense,Dmg:INTEGER);
BEGIN
		       WRITELN('You can select from sets of objects...');
		       WRITELN('Which do you want to pick up? ');
		       WRITELN('Type in the number of the item:  ');
		       WRITELN('0.  Cancel--not choosing from a set.');
		       WRITELN;
		       WRITELN('HELMET:  ');
                       WRITELN('1.  ',h1);
		       WRITELN('2.  ',h2);
		       WRITELN('3.  ',h3);
		       WRITELN('4.  ',h4);
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
		       HEAD:=Item;
		       WRITELN;
		       WRITELN('CHESTPLATE:  ');
		       WRITELN('1.  ',c1);
		       WRITELN('2.  ',c2);
		       WRITELN('3.  ',c3);
		       WRITELN('4.  ',c4);
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
		       CHEST:=Item;
		       WRITELN;
		       WRITELN('BELT:  ');
		       WRITELN('1.  ',w1);
		       WRITELN('2.  ',w2);
		       WRITELN('3.  ',w3);
		       WRITELN('4.  ',w4);
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
		       WAIST:=Item;
		       WRITELN;
		       WRITELN('FOOTWEAR:  ');
		       WRITELN('1.  ',f1);
	               WRITELN('2.  ',f2);
	               WRITELN('3.  ',f3);
		       WRITELN('4.  ',f4);
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
		       FEET:=Item;
		       WRITELN;
		       WRITELN('SHIELD:  ');
		       WRITELN('1.  ',s1);
		       WRITELN('2.  ',s2);
   		       WRITELN('3.  ',s3);
		       WRITELN('4.  ',s4);
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
  		       SHIELD:=Item;
		       WRITELN;
		       WRITELN('SWORD:  ');
		       WRITELN('1.  ',o1);
		       WRITELN('2.  ',o2);
		       WRITELN('3.  ',o3);
		       WRITELN('4.  ',o4);
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
		       OFFENSE:=Item;
		       WRITELN;
		       WRITELN('TREASURE:  ');
		       WRITELN('1.  ',d1);
	     	       WRITELN('2.  ',d2);
		       WRITELN('3.  ',d3);
		       WRITELN('4.  ',d4);  	
		       READLN(Item);
		       IF Item>4 THEN Item := 0;
		       DMG:=Item;
		       WRITELN;
		       WRITELN('All items around you vanish.');
END;		       

PROCEDURE FINALE(VAR Hc,Cc,Wc,Fc,Sc,Oc,Dc,SEEKER:INTEGER);
BEGIN
   IF (Hc=0)AND(Cc=0)AND(Wc=0)AND(Fc=0)AND(Sc=0)AND(Oc=0)AND(Dc=0) THEN
   BEGIN
	WRITELN('The demon, however, stalls.  Suddenly, there is a glow ');
	WRITELN('about you and the demon shrieks in fear.  Angels come ');
	WRITELN('out from the nearby premisis and help you.  The demon ');
	WRITELN('tries to get up, but he falls flat and gasps a sulfurous');
	WRITELN('breath of defeat and vanishes.');
	Pause;
	WRITELN('A mighty voice above says, "Well done."  You notice that');
	WRITELN('all of the dints in your armor disappear.  And you ');
	WRITELN('recall what the Lord laid on your heart about this from ');
	WRITELN('the SWORD OF THE SPIRIT--THE WORD OF GOD:  ');
	WRITELN('EPHESIANS 6:10-20.  The angels tell you that');
	WRITELN('this battle is over, but not to let your guard down.');
	WRITELN('They tell you that battles will rage on until');
	WRITELN('the day of the Lord''s return--HARVEST DAY.');
	Pause;
	IF Seeker = 1 THEN BEGIN
		WRITELN('The angels also tell you that next time');
		WRITELN('you should not seek out evil, that only by God''s');
		WRITELN('Grace did you survive.');
        END ELSE WRITELN('Well done good and faithful servant.');
   END
   ELSE BEGIN
	WRITELN('Soon a glow pierces the darkness, and angels come to your ');
	WRITELN('rescue.  The demon vanishes.');
	IF Seeker = 1 THEN BEGIN
				WRITELN('The angels speak to you:  "You must');
				WRITELN('pray for deliverance from evil. If');
				WRITELN('you seek evil, you put yourself in ');
				WRITELN('a bad position."');
			   END;
	CASE HC OF
		0:WRITELN('You chose wisely, but....');
		1:BEGIN
			WRITELN('Your eyes burn from the earlier cloud of');
			WRITELN('darkness.  An angel speaks to you:  "One ');
			WRITELN('cannot save himself for if he tries, he ');
			WRITELN('walks blindly."');
		  END;
		2:BEGIN
			WRITELN('"The only effective weapons are those not ');
			WRITELN('of this world.  Iron in this world is like');
			WRITELN('a sheet of glass in the spiritual realm," ');
			WRITELN('an angel advises you.');
		  END;
		3:BEGIN
			WRITELN('An angel notices that your helmet is');
			WRITELN('missing.  You finally make sense with ');
			WRITELN('the fact of your missing helmet:  There');
			WRITELN('is a price for greed and you had that');
			WRITELN('price on your head.');
		  END;
		4:BEGIN
			WRITELN('You notice your Viking helmet laying ');
			WRITELN('just a short distance from you.  It ');
			WRITELN('must have been ripped off your head ');
			WRITELN('during the battle.  You learned the ');
			WRITELN('hard way that worldly might counts for');
			WRITELN('nothing.');
		  END;
   	END;  
	Pause;
	CASE CC OF
		0:WRITELN('You have a good heart, but...');
		1,2,3:BEGIN
			WRITELN('You lay there in the midst of heavenly ');
			WRITELN('hosts, gaping open and bleeding.  You ');
			WRITELN('realize that you have failed and hope ');
			WRITELN('that this is not the end.  An angel ');
			WRITELN('looks upon you with a sad expression, ');
			WRITELN('and says to the other angels, "I just ');
			WRITELN('hope that this is not another one who ');
			WRITELN('loses the RACE because of not running ');
			WRITELN('the paths of righteousness.');
		      END;
		4:BEGIN
			WRITELN('Your chestplate remains on you, but it is');
			WRITELN('not in tact.  You bleed beneath it, but the');
			WRITELN('wound isn''t that bad.  An angel addresses ');
			WRITELN('you:  "It''s not a set of beliefs that are');
			WRITELN('man-made which help you.  It''s a set ');
			WRITELN('lifestyle on the narrow path."');
		  END;
	END;
	Pause;
	CASE WC OF
		0:WRITELN('You desire the truth; however...');
		1:BEGIN
  			WRITELN('You just begin to recover from your ');
			WRITELN('nearly crushed waist as you begin to ');
			WRITELN('gain your breath.  "Seek what is true,"');
			WRITELN('an angel says, "so that all your armor ');
			WRITELN('will be held together as a unit."');
		  END;
		2:BEGIN
			WRITELN('You lay flat on the ground in the center ');
			WRITELN('of the heavenly ring, and realize that ');
			WRITELN('you were living a lie in pride.');
		  END;
   	END;
	Pause;
	CASE FC OF
		0:WRITELN('You were somewhat prepared, but not enough.');
		1:BEGIN
			WRITELN('The angels help you off of your knees, ');
			WRITELN('and they tell you to be better prepared');
			WRITELN('and get on your knees, not out of');
			WRITELN('obligation, but to talk with the Lord for');
			WRITELN('He is the One you have to be ready for.');
		  END;
		2:BEGIN
			WRITELN('"Don''t trust your own instincts, for ');
			WRITELN(' your way will only lead to destruction,"');
			WRITELN('a heavenly host tells you.');
		  END;
		3:BEGIN
			WRITELN('An angel tells you that the weapons of this');
			WRITELN('world are useless and stubborn, that the ');
			WRITELN('only way you can move is via the Gospel of ');
			WRITELN('Peace.');
		  END;
		4:BEGIN
			WRITELN('You realize that you cannot do things by ');
			WRITELN('your own effort, because you will wander ');
			WRITELN('off of the path to the way that leads to ');	
			WRITELN('destruction.');
		  END;
	END;
	Pause;
	CASE SC OF
		0:BEGIN
			WRITELN('Trusting in the Lord is the key to STAND ');
			WRITELN('FIRM.  From this battle, you have learned');
			WRITELN('that you must trust Him all the more.');
		  END;
		1:BEGIN
			WRITELN('You gasp hard for breath as you lose blood');
			WRITELN('from the horrible wound from the flaming ');
			WRITELN('arrow.  Your insides burn.  You look to the');
			WRITELN('heavenly hosts about you.  You are fallen ');
			WRITELN('and weak.  You simply didn''t trust.');
		  END;
		2:BEGIN
			WRITELN('"Not even the toughest shield on earth ');
			WRITELN(' can stand up against those flaming arrows,"');
			WRITELN('an angel tells you, "for there is only one ');
			WRITELN('shield which can quench those fiery darts."');
		  END;
 	END;
	Pause;
	CASE OC OF   						
		0:WRITELN('You wounded the demon, but you didn''t really win.');
		1:BEGIN
			WRITELN('You still tremble with fear from the ');
			WRITELN('battle, but an angel says, "Fear only');
			WRITELN('the Lord your God."  You begin to take');
			WRITELN('that into consideration.');
		  END;
		2:BEGIN
			WRITELN('You hold your broken sword along with');
			WRITELN('your broken spirit.  The angels remind');
			WRITELN('you that God is the God of all comfort.');
		  END;
	END;
	Pause;
	CASE DC OF 
		0:BEGIN    							
			WRITELN('Store not your treasures hear on earth, but');
			WRITELN('store up your treasures in Heaven.');
		  END;
		1:BEGIN
		    	WRITELN('You have learned the hard way not to love ');
			WRITELN('the world or the things of it.  The world ');
			WRITELN('and all its desires and "treasures" will ');
			WRITELN('pass away.  Your "treasure" wasn''t worth');
			WRITELN('the price.  It was extra baggage.');
		  END;
	END;
   END;
END;
 
PROCEDURE WAIT(VAR Head,Chest,Waist,Feet,Shield,Offense,Dmg,seeker : INTEGER);
VAR HC,CC,WC,FC,SC,OC,DC:INTEGER;
BEGIN
   HC:=0;CC:=0;WC:=0;FC:=0;SC:=0;OC:=0;DC:=0;
   IF Seeker = 0 THEN BEGIN
   WRITELN('You decide to wait for the demon and STAND FIRM in doing so.');
   WRITELN('Sure enough, the demon arrives at the village, and seeing you');
   WRITELN('as the only challenge, he confronts you.'); END
   ELSE BEGIN
   WRITELN('You seek out the demon.  The villagers want you to stay, but ');
   WRITELN('you move on in search of evil.  Finally, you confront him.');
   WRITELN('Your eyes meet with thin yellow orbs.'); END;
   WRITELN('The battle begins...');
   WRITELN('The demon hisses, and a thick and hot cloud comes out of his');
   WRITELN('mouth.');
   Pause;
   CASE Head OF 
	0:BEGIN    						
		WRITELN('Your view and your head are engulfed.');
		WRITELN('You cannot see!'); HC:=1;
	  END;
        1:BEGIN
		WRITELN('The cloud enters into your helmet, ');
		WRITELN('and you cannot see.  The cloud is thick, ');
		WRITELN('and the small grates allow very little ');
		WRITELN('of the cloud to escape.  Your view is hindered.');
		HC:=2;
	  END;
	2:BEGIN
		WRITELN('The cloud approaches you, and your view seems ');
		WRITELN('to be blocked, but the cloud immediately ');
		WRITELN('disperses as it attempts to engulf your view.');
		WRITELN('Your vision is perfect, but the demon is angry ');
		WRITELN('because his cloud of darkness failed.');
     	  END;
	3:BEGIN 
		WRITELN('The cloud approaches you, and you see nothing ');
		WRITELN('about you but darkness.  Suddenly, a powerful '); 
		WRITELN('swipe of the demon''s arm batters you to the ');
		WRITELN('ground, and you notice your helmet is missing.');
		WRITELN('You fall to the ground in pain.'); HC:=3;
 	  END;
 	4:BEGIN 
		WRITELN('The cloud causes your view to be nothing but ');
		WRITELN('thick blackness.  Suddenly, the demon seizes ');
		WRITELN('you by the horns on your helmet.  He throws you');
		WRITELN('to the ground.'); HC:=4;
	  END;
   END;
   Pause;
   CASE CHEST OF                                                       
	0:BEGIN
		WRITELN('The demon rips his claws into you, and you ');
		WRITELN('shudder.');CC:=1;
	  END;
	1:BEGIN
		WRITELN('The demon attempts to rip his claws into you');
		WRITELN('but he only tears up his own hands in the attempt');
		WRITELN('Your chestplate proves itself.');
	  END;
	2:BEGIN
     		WRITELN('The demon lunges at you and strips the bronze from');
		WRITELN('your chest.  You are open for attack.');
		CC:=2;
	  END;
	3:BEGIN
		WRITELN('The demon lunges at you and rips the iron from your');
		WRITELN('chest.  He takes the plate of armor and sideswipes ');
		WRITELN('you to the ground.'); CC:=3;
	  END;
	4:BEGIN 
		WRITELN('The demon attacks.  He tries again and again, and ');
		WRITELN('grows more and more angry.  Finally with one final');
		WRITELN('and powerful swipe, you find a gaping hole in your');
		WRITELN('chestplate.'); CC:=4;
	  END;
   END;
   Pause;
   CASE WAIST OF 
	0..2:BEGIN
		WRITELN('The demon grips you around the waist and begins to ');
		WRITELN('crush you.'); WC:=1;
	     END;
	3:BEGIN
		WRITELN('The demon grips your waist, but you shake out of ');
		WRITELN('his evil grip.');
	  END;
	4:BEGIN
		WRITELN('You suddenly stand tall, and face the demon with ');
		WRITELN('a renewed sense of pride.  "I''m going to take');
		WRITELN('you down hideous beast," you declare.  The demon ');
		WRITELN('cackles, and before you know it, you are flat ');
		WRITELN('almost in a paralysis from an seemingly unseen ');
		WRITELN('attack from the demon.'); WC:=2;
	  END;
   END;
   Pause;
   WRITELN('Moving away from the demon, you regain a stable stance.');
   CASE FEET OF
	0:BEGIN 
	     WRITELN('You try to run, but the demon''s hot breath alone');
	     WRITELN('makes your feet fail.  You fall to your knees.');
	     FC:=1;
          END;
	1:BEGIN 
		WRITELN('You attempt to fly with your winged shoes, but ');
		WRITELN('the demon darts to the air faster than you, and');
		WRITELN('sends you plummetting back to the land.');
		FC:=2;
	  END;
	2:BEGIN
		WRITELN('You try to charge the demon, but the spikes on  ');
		WRITELN('your boots are stuck in the hard earth.'); FC:=3;
	  END;
	3:BEGIN
		WRITELN('You run at the demon with swiftness, but you cannot');
		WRITELN('stop.  He holds out his arm as you run into it ');
		WRITELN('aimlessly.  You fall at your enemy''s feet.');FC:=4;
	  END;
	4:BEGIN 
    		WRITELN('The demon charges you but with READINESS, you move');
		WRITELN('and the demon stumbles past you and falls to the ');
		WRITELN('ground.');
	  END;
   END;
   Pause;
   CASE SHIELD OF
	0:BEGIN WRITELN('The demon pulls from the strap on his back a ');
		WRITELN('bow and a flaming arrow.  He fires it at you,');
		WRITELN('and the arrow rips through your flesh.');SC:=1;
	  END;
	1..2,4:BEGIN
		WRITELN('The demon pulls from the strap on his back a ');
		WRITELN('bow and a flaming arrow.  He fires it at you.');
		WRITELN('You hold up your shield, but the arrow rips ');
		WRITELN('through your shield and you are wounded.');
		SC:=2;END;	                                                
	3:BEGIN
		WRITELN('The demon pulls from the strap on his back a');
		WRITELN('bow and a flaming arrow.  He fires it at you.');
		WRITELN('You hold up your shield, and the arrow bounces');
		WRITELN('off.');
	  END;
   END;
   Pause;
   CASE OFFENSE OF 
	1:BEGIN
	   	WRITELN('You retaliate and draw your sword.  It is ');
		WRITELN('sharper than any double-edged sword.  You '); 
		WRITELN('lunge at the demon, and drive the sword ');
		WRITELN('through what seem to be reptilian plates.  The ');
		WRITELN('demon howls in pain.'); END;
	0:BEGIN
    	     WRITELN('With no offensive weapon, you stand there motionless');
	     WRITELN('in fear.');
	     OC:=1;
	  END;
	2..4:BEGIN
		WRITELN('You counterattack with your sword.  You strike');
		WRITELN('the demon, but the blade breaks.'); OC:=2
	     END;
   END;
   Pause;
   CASE DMG OF
	0:BEGIN
		WRITELN('The demon moves away from you, but then he comes');
		WRITELN('darting at you.  You run out of the demon''s route');
		WRITELN('and he darts past you.  He stops off in the ');
		WRITELN('distance, and he turns to make another charge.');
		Pause;
	        Finale(HC,CC,WC,FC,SC,OC,DC,Seeker);
	  END;
	1..4:BEGIN
		WRITELN('The demon moves away from you, but then he stares');
		WRITELN('you down and darts towards you.  You try to move, ');
		WRITELN('but your treasure is heavy and you can''t. The demon');
		WRITELN('flattens you against the earth and prepares to make');
		WRITELN('the final blow.'); DC:=1;
		Pause;
	        Finale(HC,CC,WC,FC,SC,OC,DC,Seeker);
	     END;
   END;
END;
	
PROCEDURE SEEK(VAR HEAD,CHEST,WAIST,FEET,SHIELD,OFFENSE,DMG,SEEKER: INTEGER);
BEGIN
   SEEKER:=1;
   WAIT(HEAD,CHEST,WAIST,FEET,SHIELD,OFFENSE,DMG,SEEKER);
END;

PROCEDURE CENTER(VAR Head,Chest,Waist,Feet,Shield,Offense,Dmg : INTEGER);
VAR I,ITEM : INTEGER;
BEGIN
   Item := 5;
   WHILE Item >= 5 DO BEGIN
   WRITELN('You must get your ARMOR.');
   WRITELN('In the village, people have been telling you how a demon has ');
   WRITELN('been attacking and destroying the village.  No one knows what');
   WRITELN('to do except panic.  You, however, are going to prepare.');
   Getter(Item,HEAD,CHEST,WAIST,FEET,SHIELD,OFFENSE,DMG);
   Pause;
   Armory(Head,Chest,Waist,Feet,Shield,Offense,Dmg); 
   END;
END;

PROCEDURE MAIN;
BEGIN
   HEAD:=0; CHEST:=0; WAIST:=0; FEET:=0; SHIELD:=0; OFFENSE:=0; 
   DMG:=0; CHOICE:=0; Seeker:=0;
   WRITELN('Welcome to the game of Spiritual War.');
   WRITELN('This is a short and simple game...');
   WRITELN(' but it isn''t necessarily easy.');
   WRITELN('In fact, this simulation is based on something that ');
   WRITELN('isn''t a game at all, but a lifestyle and a way to survive ');
   WRITELN('in this dark world.');
   WRITELN('In this game, you only have one chance to do anything.');
   WRITELN('When you pick up an item, for example, it is yours for ');
   WRITELN('the rest of the game.  You don''t select your actions.');
   WRITELN('You select your tools so to speak.');
   WRITELN('THE ULTIMATE OUTCOME IS BASED ON YOUR DECISIONS.');  
   WRITELN('Let''s begin...');
   Pause;
   WRITELN('You are alone without anything.  Life has been very difficult.');
   WRITELN('Every battle you have battled in, you have lost, but for some');
   WRITELN('reason, you feel like you have a chance.');
   WRITELN;
   WRITELN('Prepare to choose your armor.  How you choose determines ');
   WRITELN('how you do.');
   Pause;
   Center(Head,Chest,Waist,Feet,Shield,Offense,Dmg);
   WRITELN('Now, you have your armor and weapons.  Do you want to...'); 
   WRITELN('1.  Wait for the demon to attack the village?');
   WRITELN('			   OR			 ');
   WRITELN('2.  Seek out the demon for yourself?');
   WRITELN('Enter the number of your choice.');
   READLN(Choice);
   CASE Choice OF 
	1:Wait(Head,Chest,Waist,Feet,Shield,Offense,Dmg,seeker);
	2:Seek(Head,Chest,Waist,Feet,Shield,Offense,Dmg,seeker);
   END;
END;

BEGIN MAIN END.

