terminal_hero 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1318f0ca89267904dfbee3fb0a34a0ba11f80521ae28e84fc5ca25add0ca261f
|
4
|
+
data.tar.gz: 9e7d7e4d19744f6c0eb66fb8416d40f4bfefdf4aa190dbc3f49b291b0f8b8bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed0bc8c956efa23ef02ba42c30e5cc8566247f878ede66f9a3d103fe775063638b325fc8c2b2563dad2cb448cfaf91f807f2e535ae524e6cba0f448aa2d330b
|
7
|
+
data.tar.gz: c90e7749c31773a8597e9b92fc601f007f572c19cc4c44d11d7588006736e639922187d17380d98b372155bdaab0fa9eb8d5a0761e539ece9a4fdc39c23eb893
|
@@ -24,6 +24,11 @@ class Player < Creature
|
|
24
24
|
return (constant * (current_lvl**exponent)).round
|
25
25
|
end
|
26
26
|
|
27
|
+
# Calculate max HP based on stats (constitution). Overrides Creature method - Player has 50 extra health to reduce difficulty.
|
28
|
+
def calc_max_hp
|
29
|
+
return @stats[:con][:value] * GameData::CON_TO_HP + 50
|
30
|
+
end
|
31
|
+
|
27
32
|
# Apply any healing and XP gain or loss after the end of a combat encounter,
|
28
33
|
# based on the outcome of the combat and the enemy fought. Return xp gained or lost (if any) for display to the user.
|
29
34
|
def post_combat(outcome, enemy)
|
@@ -1,3 +1,16 @@
|
|
1
|
+
begin
|
2
|
+
require "colorize"
|
3
|
+
rescue LoadError => e
|
4
|
+
# Display load errors using puts (not calling external methods which may not have been loaded)
|
5
|
+
puts "It appears that a dependency was unable to be loaded: "
|
6
|
+
puts e.message
|
7
|
+
puts "Please try installing dependencies mannually by running the command "\
|
8
|
+
"\"bundle install\" from within the installation directory."
|
9
|
+
puts "If you installed this application as a gem, you could try reinstalling it by "\
|
10
|
+
"running \"gem uninstall terminal_hero\" followed by \"gem install terminal_hero\""
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
|
1
14
|
# Represents a terrain or entity tile on the map
|
2
15
|
class Tile
|
3
16
|
attr_accessor :blocking, :event
|
@@ -221,7 +221,7 @@ module GameData
|
|
221
221
|
"You will select your action each round from a list of options."
|
222
222
|
msgs.push "Combat continues until you or the enemy loses all their hit points (HP), or you flee the battle."
|
223
223
|
msgs.push "When you defeat an enemy, you will gain experience points (XP). When you lose, you will lose some XP"\
|
224
|
-
"(but you won't lose levels). You will then be revived with full HP."
|
224
|
+
" (but you won't lose levels). You will then be revived with full HP."
|
225
225
|
msgs.push "When you gain enough XP, you will level up."
|
226
226
|
msgs.push "Leveling up awards stat points, which you can expend to increase your combat statistics. These are:"
|
227
227
|
msgs.push "#{'Attack'.colorize(:red)}: With higher attack, you will deal more damage in combat."
|