Class: DenoShadow

Inherits:
Object
  • Object
show all
Defined in:
lib/denofshadows.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'Den of Shadows', locations = {'east' => DenEast, 'west' => DenWest, 'northeast' => DenNortheast, 'north' => DenNorth}, visit = 0, fightchance = 3, monsters = 0) ⇒ DenoShadow

Returns a new instance of DenoShadow.



6
7
8
9
10
11
12
# File 'lib/denofshadows.rb', line 6

def initialize (name = 'Den of Shadows', locations={'east' => DenEast, 'west' => DenWest, 'northeast' => DenNortheast, 'north' => DenNorth}, visit = 0, fightchance = 3, monsters = 0)
	@name = name
	@locations = locations
	@visit = visit
	@fightchance = fightchance
	@monsters = monsters
end

Instance Attribute Details

#fightchanceObject

Returns the value of attribute fightchance.



4
5
6
# File 'lib/denofshadows.rb', line 4

def fightchance
  @fightchance
end

#locationsObject

Returns the value of attribute locations.



4
5
6
# File 'lib/denofshadows.rb', line 4

def locations
  @locations
end

#monstersObject

Returns the value of attribute monsters.



4
5
6
# File 'lib/denofshadows.rb', line 4

def monsters
  @monsters
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/denofshadows.rb', line 4

def name
  @name
end

#visitObject

Returns the value of attribute visit.



4
5
6
# File 'lib/denofshadows.rb', line 4

def visit
  @visit
end

Instance Method Details

#introductionObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/denofshadows.rb', line 14

def introduction
	if self.visit == 0
		puts 'You find yourself at the mouth of a large cave. The wind is'
		puts 'blowing in such a manner that a low, howling noise can be heard.'
		puts 'You notice fresh foot prints on the ground and expect this might'
		puts 'be more difficult than you had anticipated. However, having come'
		puts 'this far, you see no point in turning back and decided to head'
		puts 'into the cave.'
		$player.visited << Den_of_Shadowsloc
	end

	unless self.visit == 0
		puts 'You find yourself at the mouth of a large cave. The wind is'
		puts 'blowing in such a manner that a low, howling noise can be heard.'
	end
end

#lookObject



31
32
33
34
35
36
37
# File 'lib/denofshadows.rb', line 31

def look
	puts 'You find yourself in a large cavern, dome-shaped cavern. the ceiling'
	puts 'is high and you notice that it is not a natural formation. Small,'
	puts 'discreet designs can be seen repeating across it. There are four'
	puts 'corridors branching from this cavern. You see a light flickering from'
	puts 'the northern most pathway. (north, east, west, northeast)'
end