gamefic-standard 4.0.0 → 4.0.1

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: 5ad2cabfd4a0d81673d3ec48454ea842e5d5f68b5bb621b7b685b9d01d20ad16
4
- data.tar.gz: 32e4c483f7a04eebe5bdec3e85f37a90341f2a3afe8f2e879bcda9808956ee31
3
+ metadata.gz: ca3a0186e345a9afcd439decd174e1e0d25af882a3c12a4fae8c93ce7dc148a9
4
+ data.tar.gz: 983d0edf810abcade4ccca1ebcdb45d9052968cea7e614f4dd478d79d4fdc94b
5
5
  SHA512:
6
- metadata.gz: 7c7cb2add780225ba638fba5d266abf2abdeabc4c01a5c0a55e6fdbd4c42a76d43c84f0ce20c8fc3807bb180553aa3570c448c1544b744e39ca06fbf392e8225
7
- data.tar.gz: fe1479675ff888e72be337f5eb6f206b677a7fe5442cd343ed1442a48ef6079dcff3ddafce156e6e69c595282241133ccb7d6de3c99d1c2aed375144ebc177cf
6
+ metadata.gz: 10f9e483b14180248220dec5dfb2d99a331ef54f06f3e2cedd869a2577fdd6bc968457e0675bbc6af16f48f79a4585b5c0215d247053ee089f742a3d5ebe3dc7
7
+ data.tar.gz: 5afbf188e3dde7b5850aedc9e7f45bc5dc9b0c46f0cd913a16f60142e8d2d2ddcf184507b4f7c2cb68b72671d2ec1df1307a1171f421428bf68d387961d84c2d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.0.1 - May 26, 2025
2
+ - Fix lock/unlock actions
3
+
1
4
  ## 4.0.0 - January 25, 2025
2
5
  - Updates for Gamefic 4.0
3
6
 
@@ -10,10 +10,22 @@ module Gamefic
10
10
  actor.tell "You can't lock #{the thing}."
11
11
  end
12
12
 
13
+ respond :lock, available(Lockable) do |actor, thing|
14
+ if thing.has_lock_key? && actor.children.include?(thing.lock_key)
15
+ actor.execute :lock, thing, thing.lock_key
16
+ else
17
+ actor.tell "You can't lock #{the thing}."
18
+ end
19
+ end
20
+
13
21
  respond :lock, available(Lockable, proc(&:has_lock_key?)), children do |actor, thing, key|
14
22
  if thing.lock_key == key
15
- thing.locked = true
16
- actor.tell "You lock ##{the thing} with #{the key}."
23
+ if thing.locked?
24
+ actor.tell "It's already locked."
25
+ else
26
+ thing.locked = true
27
+ actor.tell "You lock #{the thing} with #{the key}."
28
+ end
17
29
  else
18
30
  actor.tell "You can't lock #{the thing} with #{the key}."
19
31
  end
@@ -24,7 +36,7 @@ module Gamefic
24
36
  actor.proceed if key.parent == actor
25
37
  end
26
38
 
27
- interpret "lock :container with :key", "lock :container :key"
39
+ interpret "lock :container with :key", "lock :container :key"
28
40
  end
29
41
  end
30
42
  end
@@ -16,8 +16,12 @@ module Gamefic
16
16
 
17
17
  respond :unlock, available(Lockable, proc(&:has_lock_key?)), children do |actor, thing, key|
18
18
  if thing.lock_key == key
19
- thing.locked = false
20
- actor.tell "You unlock #{the thing} with #{the key}."
19
+ if thing.locked?
20
+ thing.locked = false
21
+ actor.tell "You unlock #{the thing} with #{the key}."
22
+ else
23
+ actor.tell "It's already unlocked."
24
+ end
21
25
  else
22
26
  actor.tell "You can't unlock #{the thing} with #{the key}."
23
27
  end
@@ -50,6 +50,12 @@ module Gamefic
50
50
  connect destination, direction: direction
51
51
  end
52
52
  end
53
+
54
+ def one_way=(destinations)
55
+ [destinations].flatten.each do |destination|
56
+ connect destination, two_way: false
57
+ end
58
+ end
53
59
  end
54
60
  end
55
61
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gamefic
4
4
  module Standard
5
- VERSION = '4.0.0'
5
+ VERSION = '4.0.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic-standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-25 00:00:00.000000000 Z
11
+ date: 2025-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.3.7
217
+ rubygems_version: 3.5.22
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: The Gamefic standard script library.