gemwarrior 0.12.8 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/default_world.yaml +70 -4
- data/lib/gemwarrior/battle.rb +5 -0
- data/lib/gemwarrior/entities/armor.rb +7 -1
- data/lib/gemwarrior/entities/armor/leather_jerkin.rb +17 -0
- data/lib/gemwarrior/entities/entity.rb +3 -0
- data/lib/gemwarrior/entities/item.rb +18 -0
- data/lib/gemwarrior/entities/items/chest.rb +40 -0
- data/lib/gemwarrior/entities/items/tree.rb +25 -0
- data/lib/gemwarrior/entities/monsters/bosses/jaspern.rb +4 -0
- data/lib/gemwarrior/entities/player.rb +25 -15
- data/lib/gemwarrior/entities/weapon.rb +14 -6
- data/lib/gemwarrior/entities/weapons/dagger.rb +6 -0
- data/lib/gemwarrior/entities/weapons/gun.rb +1 -0
- data/lib/gemwarrior/entities/weapons/mace.rb +1 -0
- data/lib/gemwarrior/entities/weapons/opalaser.rb +1 -0
- data/lib/gemwarrior/entities/weapons/spear.rb +1 -0
- data/lib/gemwarrior/entities/weapons/stalactite.rb +6 -0
- data/lib/gemwarrior/entities/weapons/stone.rb +1 -0
- data/lib/gemwarrior/inventory.rb +3 -6
- data/lib/gemwarrior/misc/player_levels.rb +2 -2
- data/lib/gemwarrior/version.rb +1 -1
- data/lib/gemwarrior/world.rb +14 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8852ede6b54154910b456a93563fd38d21b7c34
|
4
|
+
data.tar.gz: acc043b05762adf247195338f62f70018cb31517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b5930f7c5f031aee95ac2fe2e1733498392c82aa6cb4d92e523a5bebd3aa8ecefb5154b062d3341e9195b05ee1485fe9a33b5f4e1c21be9b0a02f072d930932
|
7
|
+
data.tar.gz: dca3af60864d92da16fa3bd9d02fc6034b57f423c3cda3fd1afc2db76e2e3ad137a68713b0cecfbf47fe84f3cdbc327fe04d1f1e33ba1b85947ae1cb6a40796f
|
data/data/default_world.yaml
CHANGED
@@ -3,7 +3,7 @@ locations:
|
|
3
3
|
- !ruby/object:Gemwarrior::Location
|
4
4
|
name: home
|
5
5
|
name_display: Home
|
6
|
-
description: The little, unimportant, decrepit shack that you live in. What
|
6
|
+
description: The little, unimportant, decrepit shack that you live in. What the place lacks in decisive magnanimity is made up for in cozy squalidness. Your bed covers much of the northern corner. Your beloved family chest sits at the foot of the bed.
|
7
7
|
coords: &2
|
8
8
|
:x: 5
|
9
9
|
:y: 0
|
@@ -20,6 +20,7 @@ locations:
|
|
20
20
|
equipped: false
|
21
21
|
consumable: false
|
22
22
|
used: false
|
23
|
+
used_again: false
|
23
24
|
number_of_uses:
|
24
25
|
name: bed
|
25
26
|
name_display: Bed
|
@@ -28,10 +29,24 @@ locations:
|
|
28
29
|
talkable: false
|
29
30
|
useable: true
|
30
31
|
equippable: false
|
32
|
+
- !ruby/object:Gemwarrior::Chest
|
33
|
+
equipped: false
|
34
|
+
consumable: false
|
35
|
+
used: false
|
36
|
+
used_again: false
|
37
|
+
number_of_uses:
|
38
|
+
name: chest
|
39
|
+
name_display: Chest
|
40
|
+
description: Well-crafted with solid oak, this family chest has intricate inlays all around the front and sides. It's the one thing from home you took with you when you left.
|
41
|
+
takeable: false
|
42
|
+
talkable: false
|
43
|
+
useable: true
|
44
|
+
equippable: false
|
31
45
|
- !ruby/object:Gemwarrior::Letter
|
32
46
|
equipped: false
|
33
47
|
consumable: false
|
34
48
|
used: false
|
49
|
+
used_again: false
|
35
50
|
number_of_uses:
|
36
51
|
name: letter
|
37
52
|
name_display: Letter
|
@@ -44,6 +59,7 @@ locations:
|
|
44
59
|
equipped: false
|
45
60
|
consumable: false
|
46
61
|
used: false
|
62
|
+
used_again: false
|
47
63
|
number_of_uses:
|
48
64
|
name: stone
|
49
65
|
name_display: Stone
|
@@ -55,10 +71,12 @@ locations:
|
|
55
71
|
useable: true
|
56
72
|
equippable: true
|
57
73
|
is_weapon: true
|
74
|
+
dex_mod: 0
|
58
75
|
- !ruby/object:Gemwarrior::Tent
|
59
76
|
equipped: false
|
60
77
|
consumable: false
|
61
78
|
used: false
|
79
|
+
used_again: false
|
62
80
|
number_of_uses: 5
|
63
81
|
name: tent
|
64
82
|
name_display: Tent
|
@@ -117,6 +135,7 @@ locations:
|
|
117
135
|
equipped: false
|
118
136
|
consumable: false
|
119
137
|
used: false
|
138
|
+
used_again: false
|
120
139
|
number_of_uses:
|
121
140
|
name: stalactite
|
122
141
|
name_display: Stalactite
|
@@ -132,6 +151,7 @@ locations:
|
|
132
151
|
equipped: false
|
133
152
|
consumable: false
|
134
153
|
used: false
|
154
|
+
used_again: false
|
135
155
|
number_of_uses:
|
136
156
|
name: stonemite
|
137
157
|
name_display: Stonemite
|
@@ -190,6 +210,7 @@ locations:
|
|
190
210
|
equipped: false
|
191
211
|
consumable: false
|
192
212
|
used: false
|
213
|
+
used_again: false
|
193
214
|
number_of_uses:
|
194
215
|
name: ladder
|
195
216
|
name_display: Ladder
|
@@ -419,6 +440,7 @@ locations:
|
|
419
440
|
equipped: false
|
420
441
|
consumable: false
|
421
442
|
used: false
|
443
|
+
used_again: false
|
422
444
|
number_of_uses:
|
423
445
|
name: small_hole
|
424
446
|
name_display: Small Hole
|
@@ -480,6 +502,7 @@ locations:
|
|
480
502
|
equipped: false
|
481
503
|
consumable: false
|
482
504
|
used: false
|
505
|
+
used_again: false
|
483
506
|
number_of_uses:
|
484
507
|
name: rope
|
485
508
|
name_display: Rope
|
@@ -631,6 +654,7 @@ locations:
|
|
631
654
|
equipped: false
|
632
655
|
consumable: false
|
633
656
|
used: false
|
657
|
+
used_again: false
|
634
658
|
number_of_uses:
|
635
659
|
name: snowman
|
636
660
|
name_display: Snowman
|
@@ -757,6 +781,7 @@ locations:
|
|
757
781
|
equipped: false
|
758
782
|
consumable: false
|
759
783
|
used: false
|
784
|
+
used_again: false
|
760
785
|
number_of_uses:
|
761
786
|
name: map
|
762
787
|
name_display: Map
|
@@ -792,6 +817,7 @@ locations:
|
|
792
817
|
equipped: false
|
793
818
|
consumable: false
|
794
819
|
used: false
|
820
|
+
used_again: false
|
795
821
|
number_of_uses:
|
796
822
|
name: tree
|
797
823
|
name_display: Tree
|
@@ -799,7 +825,7 @@ locations:
|
|
799
825
|
second great-uncle.
|
800
826
|
takeable: false
|
801
827
|
talkable: false
|
802
|
-
useable:
|
828
|
+
useable: true
|
803
829
|
equippable: false
|
804
830
|
monsters_abounding: []
|
805
831
|
bosses_abounding: []
|
@@ -850,6 +876,7 @@ locations:
|
|
850
876
|
equipped: false
|
851
877
|
consumable: false
|
852
878
|
used: false
|
879
|
+
used_again: false
|
853
880
|
number_of_uses:
|
854
881
|
name: feather
|
855
882
|
name_display: Feather
|
@@ -885,6 +912,7 @@ locations:
|
|
885
912
|
equipped: false
|
886
913
|
consumable: false
|
887
914
|
used: false
|
915
|
+
used_again: false
|
888
916
|
number_of_uses:
|
889
917
|
name: bookcase
|
890
918
|
name_display: Bookcase
|
@@ -1007,6 +1035,7 @@ locations:
|
|
1007
1035
|
equipped: false
|
1008
1036
|
consumable: false
|
1009
1037
|
used: false
|
1038
|
+
used_again: false
|
1010
1039
|
number_of_uses:
|
1011
1040
|
talkable: false
|
1012
1041
|
name: sand_jewel
|
@@ -1178,6 +1207,7 @@ locations:
|
|
1178
1207
|
equipped: false
|
1179
1208
|
consumable: false
|
1180
1209
|
used: false
|
1210
|
+
used_again: false
|
1181
1211
|
number_of_uses:
|
1182
1212
|
name: arena_door
|
1183
1213
|
name_display: Arena Door
|
@@ -1214,6 +1244,7 @@ locations:
|
|
1214
1244
|
equipped: false
|
1215
1245
|
consumable: false
|
1216
1246
|
used: false
|
1247
|
+
used_again: false
|
1217
1248
|
number_of_uses:
|
1218
1249
|
talkable: true
|
1219
1250
|
name: arena_master
|
@@ -1269,6 +1300,7 @@ locations:
|
|
1269
1300
|
equipped: false
|
1270
1301
|
consumable: false
|
1271
1302
|
used: false
|
1303
|
+
used_again: false
|
1272
1304
|
number_of_uses:
|
1273
1305
|
talkable: false
|
1274
1306
|
name: hut
|
@@ -1414,7 +1446,20 @@ locations:
|
|
1414
1446
|
begin: 1
|
1415
1447
|
end: 2
|
1416
1448
|
excl: false
|
1417
|
-
items:
|
1449
|
+
items:
|
1450
|
+
- !ruby/object:Gemwarrior::Bullet
|
1451
|
+
equipped: false
|
1452
|
+
consumable: false
|
1453
|
+
used: false
|
1454
|
+
used_again: false
|
1455
|
+
number_of_uses:
|
1456
|
+
talkable: false
|
1457
|
+
name: bullet
|
1458
|
+
name_display: Bullet
|
1459
|
+
description: Gunpowder packed into a small metallic tube, ready to be fired from...something.
|
1460
|
+
takeable: true
|
1461
|
+
useable: true
|
1462
|
+
equippable: false
|
1418
1463
|
monsters_abounding: []
|
1419
1464
|
bosses_abounding: []
|
1420
1465
|
checked_for_monsters: false
|
@@ -1439,6 +1484,7 @@ locations:
|
|
1439
1484
|
equipped: false
|
1440
1485
|
consumable: false
|
1441
1486
|
used: false
|
1487
|
+
used_again: false
|
1442
1488
|
number_of_uses:
|
1443
1489
|
talkable: true
|
1444
1490
|
name: ware_hawker
|
@@ -1473,6 +1519,7 @@ locations:
|
|
1473
1519
|
equipped: false
|
1474
1520
|
consumable: false
|
1475
1521
|
used: false
|
1522
|
+
used_again: false
|
1476
1523
|
number_of_uses:
|
1477
1524
|
talkable: true
|
1478
1525
|
name: thin_man
|
@@ -1488,6 +1535,7 @@ locations:
|
|
1488
1535
|
equipped: false
|
1489
1536
|
consumable: false
|
1490
1537
|
used: false
|
1538
|
+
used_again: false
|
1491
1539
|
number_of_uses:
|
1492
1540
|
talkable: true
|
1493
1541
|
name: drunk_man
|
@@ -1522,6 +1570,7 @@ locations:
|
|
1522
1570
|
equipped: false
|
1523
1571
|
consumable: false
|
1524
1572
|
used: false
|
1573
|
+
used_again: false
|
1525
1574
|
number_of_uses:
|
1526
1575
|
talkable: true
|
1527
1576
|
name: pig
|
@@ -1534,6 +1583,7 @@ locations:
|
|
1534
1583
|
equipped: false
|
1535
1584
|
consumable: false
|
1536
1585
|
used: false
|
1586
|
+
used_again: false
|
1537
1587
|
number_of_uses:
|
1538
1588
|
talkable: true
|
1539
1589
|
name: cow
|
@@ -1546,6 +1596,7 @@ locations:
|
|
1546
1596
|
equipped: false
|
1547
1597
|
consumable: false
|
1548
1598
|
used: false
|
1599
|
+
used_again: false
|
1549
1600
|
number_of_uses:
|
1550
1601
|
talkable: true
|
1551
1602
|
name: goat
|
@@ -1580,6 +1631,7 @@ locations:
|
|
1580
1631
|
equipped: false
|
1581
1632
|
consumable: false
|
1582
1633
|
used: false
|
1634
|
+
used_again: false
|
1583
1635
|
number_of_uses:
|
1584
1636
|
talkable: true
|
1585
1637
|
name: shifty_woman
|
@@ -1617,6 +1669,7 @@ locations:
|
|
1617
1669
|
equipped: false
|
1618
1670
|
consumable: false
|
1619
1671
|
used: false
|
1672
|
+
used_again: false
|
1620
1673
|
number_of_uses:
|
1621
1674
|
name: gun
|
1622
1675
|
name_display: Gun
|
@@ -1632,6 +1685,7 @@ locations:
|
|
1632
1685
|
equipped: false
|
1633
1686
|
consumable: false
|
1634
1687
|
used: false
|
1688
|
+
used_again: false
|
1635
1689
|
number_of_uses:
|
1636
1690
|
name: pedestal
|
1637
1691
|
name_display: Pedestal
|
@@ -1691,6 +1745,7 @@ locations:
|
|
1691
1745
|
equipped: false
|
1692
1746
|
consumable: false
|
1693
1747
|
used: false
|
1748
|
+
used_again: false
|
1694
1749
|
number_of_uses:
|
1695
1750
|
name: floor_tile
|
1696
1751
|
name_display: Floor Tile
|
@@ -1726,6 +1781,7 @@ locations:
|
|
1726
1781
|
equipped: false
|
1727
1782
|
consumable: false
|
1728
1783
|
used: false
|
1784
|
+
used_again: false
|
1729
1785
|
number_of_uses:
|
1730
1786
|
name: flower
|
1731
1787
|
name_display: Flower
|
@@ -1739,6 +1795,7 @@ locations:
|
|
1739
1795
|
equipped: false
|
1740
1796
|
consumable: false
|
1741
1797
|
used: false
|
1798
|
+
used_again: false
|
1742
1799
|
number_of_uses:
|
1743
1800
|
name: keystone
|
1744
1801
|
name_display: Keystone
|
@@ -1752,6 +1809,7 @@ locations:
|
|
1752
1809
|
equipped: false
|
1753
1810
|
consumable: false
|
1754
1811
|
used: false
|
1812
|
+
used_again: false
|
1755
1813
|
number_of_uses:
|
1756
1814
|
name: pond
|
1757
1815
|
name_display: Pond
|
@@ -1790,6 +1848,7 @@ locations:
|
|
1790
1848
|
equipped: false
|
1791
1849
|
consumable: false
|
1792
1850
|
used: false
|
1851
|
+
used_again: false
|
1793
1852
|
number_of_uses:
|
1794
1853
|
name: dehumidifier
|
1795
1854
|
name_display: Dehumidifier
|
@@ -1847,6 +1906,7 @@ locations:
|
|
1847
1906
|
equipped: false
|
1848
1907
|
consumable: false
|
1849
1908
|
used: false
|
1909
|
+
used_again: false
|
1850
1910
|
number_of_uses:
|
1851
1911
|
name: waterfall
|
1852
1912
|
name_display: Waterfall
|
@@ -1883,6 +1943,7 @@ locations:
|
|
1883
1943
|
equipped: false
|
1884
1944
|
consumable: false
|
1885
1945
|
used: false
|
1946
|
+
used_again: false
|
1886
1947
|
number_of_uses:
|
1887
1948
|
name: massive_door
|
1888
1949
|
name_display: Massive Door
|
@@ -1920,6 +1981,7 @@ locations:
|
|
1920
1981
|
equipped: false
|
1921
1982
|
consumable: false
|
1922
1983
|
used: false
|
1984
|
+
used_again: false
|
1923
1985
|
number_of_uses:
|
1924
1986
|
name: throne
|
1925
1987
|
name_display: Throne
|
@@ -1955,6 +2017,7 @@ locations:
|
|
1955
2017
|
equipped: false
|
1956
2018
|
consumable: false
|
1957
2019
|
used: false
|
2020
|
+
used_again: false
|
1958
2021
|
number_of_uses:
|
1959
2022
|
name: couch
|
1960
2023
|
name_display: Couch
|
@@ -2013,6 +2076,7 @@ locations:
|
|
2013
2076
|
equipped: false
|
2014
2077
|
consumable: false
|
2015
2078
|
used: false
|
2079
|
+
used_again: false
|
2016
2080
|
number_of_uses:
|
2017
2081
|
name: apple
|
2018
2082
|
name_display: Apple
|
@@ -2025,6 +2089,7 @@ locations:
|
|
2025
2089
|
equipped: false
|
2026
2090
|
consumable: false
|
2027
2091
|
used: false
|
2092
|
+
used_again: false
|
2028
2093
|
number_of_uses:
|
2029
2094
|
name: cup
|
2030
2095
|
name_display: Cup
|
@@ -2057,6 +2122,7 @@ locations:
|
|
2057
2122
|
equipped: false
|
2058
2123
|
consumable: false
|
2059
2124
|
used: false
|
2125
|
+
used_again: false
|
2060
2126
|
number_of_uses:
|
2061
2127
|
name: queen_ruby
|
2062
2128
|
description: Queen Ruby glimmers like she was made from the substance of her name. She wears a wan smile, and her hands are delicately intertwined as she sits patiently.
|
@@ -2081,7 +2147,7 @@ player: !ruby/object:Gemwarrior::Player
|
|
2081
2147
|
atk_lo: 1
|
2082
2148
|
atk_hi: 2
|
2083
2149
|
defense: 1
|
2084
|
-
dexterity:
|
2150
|
+
dexterity: 3
|
2085
2151
|
inventory: !ruby/object:Gemwarrior::Inventory
|
2086
2152
|
armor:
|
2087
2153
|
items: []
|
data/lib/gemwarrior/battle.rb
CHANGED
@@ -237,6 +237,11 @@ module Gemwarrior
|
|
237
237
|
attempt_success_hi += rand((a_dex)..(a_dex+2))
|
238
238
|
attempt_success_hi -= rand((d_dex)..(d_dex+2))
|
239
239
|
|
240
|
+
# weapon can change dexterity
|
241
|
+
if player.has_weapon_equipped?
|
242
|
+
attempt_success_hi += player.weapon.dex_mod
|
243
|
+
end
|
244
|
+
|
240
245
|
# compute attempt success
|
241
246
|
attempt = rand(attempt_success_lo..attempt_success_hi)
|
242
247
|
miss_cap = MISS_CAP_DEFAULT
|
@@ -19,15 +19,21 @@ module Gemwarrior
|
|
19
19
|
'Save the donning of this piece of armor for battle.'
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def describe_detailed
|
23
23
|
desc_text = "\"#{name_display}\"\n".colorize(:yellow)
|
24
24
|
desc_text << "(#{name})\n".colorize(:green)
|
25
25
|
desc_text << "#{description}\n".colorize(:white)
|
26
|
+
desc_text << "ARMOR? #{is_armor}\n".colorize(:white)
|
26
27
|
desc_text << "DEFENSE: #{defense}\n".colorize(:white)
|
27
28
|
desc_text << "TAKEABLE? #{takeable}\n".colorize(:white)
|
28
29
|
desc_text << "USEABLE? #{useable}\n".colorize(:white)
|
30
|
+
desc_text << "TALKABLE? #{talkable}\n".colorize(:white)
|
31
|
+
desc_text << "CONSUMABLE? #{consumable}\n".colorize(:white)
|
29
32
|
desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
|
30
33
|
desc_text << "EQUIPPED? #{equipped}\n".colorize(:white)
|
34
|
+
desc_text << "USED? #{used}\n".colorize(:white)
|
35
|
+
desc_text << "USED AGAIN? #{used_again}\n".colorize(:white)
|
36
|
+
desc_text << "USES LEFT? #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil?
|
31
37
|
desc_text
|
32
38
|
end
|
33
39
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# lib/gemwarrior/entities/armor/leather_jerkin.rb
|
2
|
+
# Entity::Item::Armor::LeatherJerkin
|
3
|
+
|
4
|
+
require_relative '../armor'
|
5
|
+
|
6
|
+
module Gemwarrior
|
7
|
+
class LeatherJerkin < Armor
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
|
11
|
+
self.name = 'leather_jerkin'
|
12
|
+
self.name_display = 'Leather Jerkin'
|
13
|
+
self.description = 'Brownish-black in color and fairly form-fitting, this jerkin will soften any blow a bit, at least.'
|
14
|
+
self.defense = 2
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -18,6 +18,7 @@ module Gemwarrior
|
|
18
18
|
:equippable,
|
19
19
|
:equipped,
|
20
20
|
:used,
|
21
|
+
:used_again,
|
21
22
|
:number_of_uses
|
22
23
|
|
23
24
|
attr_reader :describe,
|
@@ -36,6 +37,7 @@ module Gemwarrior
|
|
36
37
|
self.equippable = false
|
37
38
|
self.equipped = false
|
38
39
|
self.used = false
|
40
|
+
self.used_again = false
|
39
41
|
self.number_of_uses = nil
|
40
42
|
end
|
41
43
|
|
@@ -58,6 +60,7 @@ module Gemwarrior
|
|
58
60
|
desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
|
59
61
|
desc_text << "EQUIPPED? #{equipped}\n".colorize(:white)
|
60
62
|
desc_text << "USED? #{used}\n".colorize(:white)
|
63
|
+
desc_text << "USED AGAIN? #{used_again}\n".colorize(:white)
|
61
64
|
desc_text << "USES LEFT? #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil?
|
62
65
|
desc_text
|
63
66
|
end
|
@@ -20,5 +20,23 @@ module Gemwarrior
|
|
20
20
|
def use(world)
|
21
21
|
'That item does not do anything...yet.'
|
22
22
|
end
|
23
|
+
|
24
|
+
def describe_detailed
|
25
|
+
desc_text = "\"#{name_display}\"\n".colorize(:yellow)
|
26
|
+
desc_text << "(#{name})\n".colorize(:green)
|
27
|
+
desc_text << "#{description}\n".colorize(:white)
|
28
|
+
desc_text << "ARMOR? #{is_armor}\n".colorize(:white)
|
29
|
+
desc_text << "WEAPON? #{is_weapon}\n".colorize(:white)
|
30
|
+
desc_text << "TAKEABLE? #{takeable}\n".colorize(:white)
|
31
|
+
desc_text << "USEABLE? #{useable}\n".colorize(:white)
|
32
|
+
desc_text << "TALKABLE? #{talkable}\n".colorize(:white)
|
33
|
+
desc_text << "CONSUMABLE? #{consumable}\n".colorize(:white)
|
34
|
+
desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
|
35
|
+
desc_text << "EQUIPPED? #{equipped}\n".colorize(:white)
|
36
|
+
desc_text << "USED? #{used}\n".colorize(:white)
|
37
|
+
desc_text << "USED AGAIN? #{used_again}\n".colorize(:white)
|
38
|
+
desc_text << "USES LEFT? #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil?
|
39
|
+
desc_text
|
40
|
+
end
|
23
41
|
end
|
24
42
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# lib/gemwarrior/entities/items/chest.rb
|
2
|
+
# Entity::Item::Chest
|
3
|
+
|
4
|
+
require_relative '../item'
|
5
|
+
|
6
|
+
module Gemwarrior
|
7
|
+
class Chest < Item
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
|
11
|
+
self.name = 'chest'
|
12
|
+
self.name_display = 'Chest'
|
13
|
+
self.description = 'Well-crafted with solid oak, this family chest has intricate inlays all around the front and sides. It\'s the one thing from home you took with you when you left.'
|
14
|
+
end
|
15
|
+
|
16
|
+
def use(world)
|
17
|
+
home = world.location_by_name('home')
|
18
|
+
open_description = 'You open the chest and find little inside but some dust and faded memories of your childhood.'
|
19
|
+
|
20
|
+
if self.used
|
21
|
+
if home.contains_item?('leather_jerkin')
|
22
|
+
open_description += ' The old sword fighting garment is still in there, too.'
|
23
|
+
end
|
24
|
+
puts open_description
|
25
|
+
|
26
|
+
{ type: nil, data: nil }
|
27
|
+
else
|
28
|
+
open_description += ' That, and a slightly dirty, but still useful garment you remember using while taking those sword fighting lessons as a small boy.'
|
29
|
+
|
30
|
+
puts open_description
|
31
|
+
|
32
|
+
home.items.push(LeatherJerkin.new)
|
33
|
+
|
34
|
+
self.used = true
|
35
|
+
|
36
|
+
{ type: nil, data: nil }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -12,5 +12,30 @@ module Gemwarrior
|
|
12
12
|
self.name_display = 'Tree'
|
13
13
|
self.description = 'A mighty representation of nature, older than your father\'s father\'s second great-uncle.'
|
14
14
|
end
|
15
|
+
|
16
|
+
def use(world)
|
17
|
+
if self.used_again
|
18
|
+
puts 'The tree, its trunk, and the hole in its side all seem fairly unremarkable to you now.'
|
19
|
+
|
20
|
+
return { type: nil, data: nil }
|
21
|
+
elsif self.used
|
22
|
+
self.used_again = true
|
23
|
+
|
24
|
+
puts 'Looking further into the small opening in the trunk your eye catches the light glinting off a few small metallic objects.'
|
25
|
+
|
26
|
+
cur_loc = world.location_by_name('forest-southeast')
|
27
|
+
cur_loc.items.push(Bullet.new)
|
28
|
+
cur_loc.items.push(Bullet.new)
|
29
|
+
cur_loc.items.push(Bullet.new)
|
30
|
+
|
31
|
+
return { type: nil, data: nil }
|
32
|
+
else
|
33
|
+
self.used = true
|
34
|
+
|
35
|
+
puts 'Taking a passing glance into the only hole in the tree big enough for anything to exist inside, you don\'t quite see anything of value.'
|
36
|
+
|
37
|
+
{ type: nil, data: nil }
|
38
|
+
end
|
39
|
+
end
|
15
40
|
end
|
16
41
|
end
|
@@ -32,6 +32,10 @@ module Gemwarrior
|
|
32
32
|
self.is_boss = true
|
33
33
|
end
|
34
34
|
|
35
|
+
def use(world)
|
36
|
+
speak('You are not going any further north, little man. No matter of talking will move me!')
|
37
|
+
end
|
38
|
+
|
35
39
|
def river_bridge_success(world)
|
36
40
|
# get object references
|
37
41
|
river_bridge = world.location_by_name('river_bridge')
|
@@ -52,20 +52,24 @@ module Gemwarrior
|
|
52
52
|
print_char_pic
|
53
53
|
end
|
54
54
|
|
55
|
-
weapon_slot
|
56
|
-
armor_slot
|
57
|
-
base_atk_lo
|
58
|
-
base_atk_hi
|
59
|
-
base_defense
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
weapon_slot = '(unarmed)'
|
56
|
+
armor_slot = '(unarmored)'
|
57
|
+
base_atk_lo = self.atk_lo
|
58
|
+
base_atk_hi = self.atk_hi
|
59
|
+
base_defense = self.defense
|
60
|
+
base_dexterity = self.dexterity
|
61
|
+
net_atk_lo = nil
|
62
|
+
net_atk_hi = nil
|
63
|
+
net_defense = nil
|
64
|
+
net_dexterity = nil
|
63
65
|
|
64
66
|
# juice the weapon display
|
65
67
|
if has_weapon_equipped?
|
66
|
-
|
67
|
-
|
68
|
-
|
68
|
+
binding.pry
|
69
|
+
weapon_slot = self.inventory.weapon.name
|
70
|
+
net_atk_lo = base_atk_lo + self.inventory.weapon.atk_lo
|
71
|
+
net_atk_hi = base_atk_hi + self.inventory.weapon.atk_hi
|
72
|
+
net_dexterity = self.dexterity + self.inventory.weapon.dex_mod
|
69
73
|
end
|
70
74
|
|
71
75
|
# juice the armor display
|
@@ -84,7 +88,8 @@ module Gemwarrior
|
|
84
88
|
end
|
85
89
|
end
|
86
90
|
|
87
|
-
self_text = "
|
91
|
+
self_text = "\n"
|
92
|
+
self_text << "NAME : #{self.name.colorize(:green)}\n"
|
88
93
|
self_text << "LEVEL : #{self.level}\n"
|
89
94
|
self_text << "EXPERIENCE: #{self.xp}\n"
|
90
95
|
self_text << "HIT POINTS: #{self.hp_cur}/#{self.hp_max}\n"
|
@@ -96,11 +101,16 @@ module Gemwarrior
|
|
96
101
|
self_text << "DEFENSE : #{base_defense}"
|
97
102
|
self_text << " (#{net_defense} w/ #{armor_slot})".colorize(:yellow) unless net_defense.nil?
|
98
103
|
self_text << "\n"
|
99
|
-
self_text << "DEXTERITY : #{self.dexterity}
|
104
|
+
self_text << "DEXTERITY : #{self.dexterity}"
|
105
|
+
self_text << " (#{net_dexterity} w/ #{weapon_slot})".colorize(:yellow) unless net_dexterity.nil?
|
106
|
+
self_text << "\n"
|
100
107
|
self_text << "ABILITIES :"
|
101
108
|
self_text << "#{abilities}"
|
109
|
+
self_text << "INVENTORY : #{self.inventory.contents}\n"
|
102
110
|
|
103
111
|
if GameOptions.data['debug_mode']
|
112
|
+
self_text << "\n"
|
113
|
+
self_text << "[DEBUG STUFF]\n"
|
104
114
|
self_text << ">> POSITION : #{self.cur_coords.values.to_a}\n"
|
105
115
|
self_text << ">> GOD_MODE : #{GameOptions.data['god_mode']}\n"
|
106
116
|
self_text << ">> BEAST_MODE : #{GameOptions.data['beast_mode']}\n"
|
@@ -114,11 +124,11 @@ module Gemwarrior
|
|
114
124
|
|
115
125
|
self_text << "\n"
|
116
126
|
|
117
|
-
self_text << "[Your Story]\n#{self.description}"
|
127
|
+
self_text << "[#{"Your Story".colorize(:yellow)}]\n#{self.description}"
|
118
128
|
|
119
129
|
self_text << "\n\n"
|
120
130
|
|
121
|
-
self_text << "[Current Status]\nBreathing, non-naked, with a #{self.face.colorize(:yellow)} face, #{self.hands.colorize(:yellow)} hands, and feeling, generally, #{self.mood.colorize(:yellow)}."
|
131
|
+
self_text << "[#{"Current Status".colorize(:yellow)}]\nBreathing, non-naked, with a #{self.face.colorize(:yellow)} face, #{self.hands.colorize(:yellow)} hands, and feeling, generally, #{self.mood.colorize(:yellow)}."
|
122
132
|
|
123
133
|
self_text << "\n"
|
124
134
|
end
|
@@ -7,6 +7,7 @@ module Gemwarrior
|
|
7
7
|
class Weapon < Item
|
8
8
|
attr_accessor :atk_lo,
|
9
9
|
:atk_hi,
|
10
|
+
:dex_mod,
|
10
11
|
:is_weapon
|
11
12
|
|
12
13
|
def initialize
|
@@ -14,24 +15,31 @@ module Gemwarrior
|
|
14
15
|
|
15
16
|
self.atk_lo = 0
|
16
17
|
self.atk_hi = 0
|
18
|
+
self.dex_mod = 0
|
17
19
|
self.takeable = true
|
18
20
|
self.equippable = true
|
19
21
|
self.is_weapon = true
|
20
22
|
end
|
21
23
|
|
22
24
|
def use(world)
|
23
|
-
'Save the
|
25
|
+
'Save the brrandishing of your weapon for battle.'
|
24
26
|
end
|
25
27
|
|
26
28
|
def describe_detailed
|
27
29
|
desc_text = "\"#{name_display}\"\n".colorize(:yellow)
|
28
30
|
desc_text << "(#{name})\n".colorize(:green)
|
29
31
|
desc_text << "#{description}\n".colorize(:white)
|
30
|
-
desc_text << "
|
31
|
-
desc_text << "
|
32
|
-
desc_text << "
|
33
|
-
desc_text << "
|
34
|
-
desc_text << "
|
32
|
+
desc_text << "WEAPON? #{is_weapon}\n".colorize(:white)
|
33
|
+
desc_text << "ATTACK_RANGE : #{atk_lo}-#{atk_hi}\n".colorize(:white)
|
34
|
+
desc_text << "TAKEABLE? #{takeable}\n".colorize(:white)
|
35
|
+
desc_text << "USEABLE? #{useable}\n".colorize(:white)
|
36
|
+
desc_text << "TALKABLE? #{talkable}\n".colorize(:white)
|
37
|
+
desc_text << "CONSUMABLE? #{consumable}\n".colorize(:white)
|
38
|
+
desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
|
39
|
+
desc_text << "EQUIPPED? #{equipped}\n".colorize(:white)
|
40
|
+
desc_text << "USED? #{used}\n".colorize(:white)
|
41
|
+
desc_text << "USED AGAIN? #{used_again}\n".colorize(:white)
|
42
|
+
desc_text << "USES LEFT? #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil?
|
35
43
|
desc_text
|
36
44
|
end
|
37
45
|
end
|
@@ -13,6 +13,12 @@ module Gemwarrior
|
|
13
13
|
self.description = 'Flint that has been sharpened to a point, attached to a block of smooth granite by thin rope. Truly a work of art.'
|
14
14
|
self.atk_lo = 1
|
15
15
|
self.atk_hi = 3
|
16
|
+
self.dex_mod = 1
|
17
|
+
end
|
18
|
+
|
19
|
+
def use(world)
|
20
|
+
puts 'You graze the blade of the dagger lightly and find it to be plenty sharp.'
|
21
|
+
{ type: nil, data: nil }
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
@@ -13,6 +13,12 @@ module Gemwarrior
|
|
13
13
|
self.description = 'Long protrusion of cave adornment, broken off and fallen to the ground, where the stalagmites sneer at it from.'
|
14
14
|
self.atk_lo = 2
|
15
15
|
self.atk_hi = 3
|
16
|
+
self.dex_mod = -1
|
17
|
+
end
|
18
|
+
|
19
|
+
def use(world)
|
20
|
+
puts 'You wave the stalactite around in the air a bit, testing its weight and precision. It is a thin, long piece of rock taken from a cave wall, for sure, though.'
|
21
|
+
{ type: nil, data: nil }
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
data/lib/gemwarrior/inventory.rb
CHANGED
@@ -8,7 +8,7 @@ module Gemwarrior
|
|
8
8
|
# CONSTANTS
|
9
9
|
ERROR_ITEM_REMOVE_INVALID = 'Your inventory does not contain that item, so you cannot drop it.'
|
10
10
|
ERROR_ITEM_ADD_UNTAKEABLE = 'That would be great if you could take that, wouldn\'t it? Huh!'
|
11
|
-
ERROR_ITEM_ADD_INVALID = 'That item cannot be
|
11
|
+
ERROR_ITEM_ADD_INVALID = 'That item cannot be taken or does not exist.'
|
12
12
|
ERROR_ITEM_DESCRIBE_INVALID = 'That does not seem to be in the inventory.'
|
13
13
|
ERROR_ITEM_EQUIP_INVALID = 'You do not possess anything called that to equip.'
|
14
14
|
ERROR_ITEM_EQUIP_NONARMAMENT = 'That item cannot be equipped.'
|
@@ -49,13 +49,13 @@ module Gemwarrior
|
|
49
49
|
if item_hash.length == 1
|
50
50
|
i = item_hash.keys.join
|
51
51
|
q = item_hash.values.join.to_i
|
52
|
-
return q > 1 ? "#{
|
52
|
+
return q > 1 ? "#{i}s x#{q}" : i
|
53
53
|
# multiple items? return array of strings to mush together
|
54
54
|
else
|
55
55
|
item_arr = []
|
56
56
|
item_hash.each do |i, q|
|
57
57
|
if q > 1
|
58
|
-
item_arr.push("#{i
|
58
|
+
item_arr.push("#{i}s x#{q}")
|
59
59
|
else
|
60
60
|
item_arr.push(i)
|
61
61
|
end
|
@@ -203,9 +203,6 @@ module Gemwarrior
|
|
203
203
|
if i.takeable
|
204
204
|
self.items.push(i)
|
205
205
|
cur_loc.remove_item(item_name)
|
206
|
-
if cur_loc.name.eql?('home')
|
207
|
-
cur_loc.description = 'The little, unimportant, decrepit shack that you live in. What it lacks in decisive magnanimity, it makes up for it in its cozy squalidness.'
|
208
|
-
end
|
209
206
|
|
210
207
|
# stats
|
211
208
|
player.items_taken += 1
|
@@ -10,7 +10,7 @@ module Gemwarrior
|
|
10
10
|
level: 1, xp_start: 0,
|
11
11
|
hp_max: 30, stam_max: 20,
|
12
12
|
atk_lo: 1, atk_hi: 2,
|
13
|
-
defense: 1, dexterity:
|
13
|
+
defense: 1, dexterity: 3,
|
14
14
|
special_abilities: nil
|
15
15
|
}
|
16
16
|
when 2
|
@@ -18,7 +18,7 @@ module Gemwarrior
|
|
18
18
|
level: 2, xp_start: 50,
|
19
19
|
hp_max: 35, stam_max: 25,
|
20
20
|
atk_lo: 2, atk_hi: 3,
|
21
|
-
defense: 3, dexterity:
|
21
|
+
defense: 3, dexterity: 4,
|
22
22
|
special_abilities: :rocking_vision
|
23
23
|
}
|
24
24
|
when 3
|
data/lib/gemwarrior/version.rb
CHANGED
data/lib/gemwarrior/world.rb
CHANGED
@@ -33,7 +33,20 @@ module Gemwarrior
|
|
33
33
|
end
|
34
34
|
|
35
35
|
desc_text << "\n"
|
36
|
-
|
36
|
+
|
37
|
+
point_desc = point.description.clone
|
38
|
+
|
39
|
+
# specific location description changes
|
40
|
+
if point.name.eql?('home')
|
41
|
+
if point.contains_item?('tent')
|
42
|
+
point_desc << ' Next to the bed, on the floor, is a folded-up tent.'
|
43
|
+
end
|
44
|
+
if point.contains_item?('letter')
|
45
|
+
point_desc << ' Atop the chest you notice a curious letter, folded in three.'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
desc_text << point_desc
|
37
50
|
|
38
51
|
point.populate_monsters(GameMonsters.data) unless point.checked_for_monsters?
|
39
52
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemwarrior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Chadwick
|
@@ -276,6 +276,7 @@ files:
|
|
276
276
|
- lib/gemwarrior/battle.rb
|
277
277
|
- lib/gemwarrior/entities/armor.rb
|
278
278
|
- lib/gemwarrior/entities/armor/iron_helmet.rb
|
279
|
+
- lib/gemwarrior/entities/armor/leather_jerkin.rb
|
279
280
|
- lib/gemwarrior/entities/creature.rb
|
280
281
|
- lib/gemwarrior/entities/creatures/cow.rb
|
281
282
|
- lib/gemwarrior/entities/creatures/goat.rb
|
@@ -287,6 +288,7 @@ files:
|
|
287
288
|
- lib/gemwarrior/entities/items/bed.rb
|
288
289
|
- lib/gemwarrior/entities/items/bookcase.rb
|
289
290
|
- lib/gemwarrior/entities/items/bullet.rb
|
291
|
+
- lib/gemwarrior/entities/items/chest.rb
|
290
292
|
- lib/gemwarrior/entities/items/couch.rb
|
291
293
|
- lib/gemwarrior/entities/items/cup.rb
|
292
294
|
- lib/gemwarrior/entities/items/dehumidifier.rb
|