gamefic-sdk 1.3.0 → 1.3.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
  SHA1:
3
- metadata.gz: dd968de984939b706dad22a8c19be7c4c3a78846
4
- data.tar.gz: 2501c328ff2ddcf4ddfa1810f9ff715bfa181ee3
3
+ metadata.gz: cd21c94408ecfc19f905b8344363c15a3164c4a2
4
+ data.tar.gz: 662d9daeb9161d2622aa8361d816c91fdc16eae9
5
5
  SHA512:
6
- metadata.gz: 07d9bb71a8b50df00fe994ccf3782d8c5bdeb999c3ca01ec32f6d1711165e738480b9e98e1a7b0701a4a9ec53b9a6d8a6644878b94244d7be42e55694e8fc406
7
- data.tar.gz: 12c389854dfb164f677d4719c7fc632f995c4b6579028dd437ccd0cc6c354e8f840741fff7bca3d3f6ca25e82178c8767ce038821bc4e1eac9df9bb2f96f6f7b
6
+ metadata.gz: 860ff80c0a31476a00a96b7bd8b7c5722cb3ff417e0e2d230b6de621d03d3fbde197eb370b22abeafe11cad82b97a6b9342ac7d9962b6998aaf71cdeeceff643
7
+ data.tar.gz: 3f4132cc5907ee65e5e3c9ac0ccd57da00c5a7885a640002722354d44020a7c84d82769e79fa63ea02c5116921a370f8bdf8c415fcc2b34c385a7df44ecd647d
@@ -1,5 +1,5 @@
1
1
  module Gamefic
2
2
  module Sdk
3
- VERSION = '1.3.0'
3
+ VERSION = '1.3.1'
4
4
  end
5
5
  end
@@ -3,8 +3,12 @@ respond :drop, Query::Visible.new() do |actor, thing|
3
3
  end
4
4
 
5
5
  respond :drop, Query::Children.new() do |actor, thing|
6
- thing.parent = actor.parent
7
- actor.tell "#{you.pronoun.Subj} drop #{the thing}."
6
+ if thing.sticky?
7
+ actor.tell thing.sticky_message || "#{you.pronoun.Subj} #{you.verb.need} to keep #{the thing} for now."
8
+ else
9
+ thing.parent = actor.parent
10
+ actor.tell "#{you.pronoun.Subj} drop #{the thing}."
11
+ end
8
12
  end
9
13
 
10
14
  interpret "put down :thing", "drop :thing"
@@ -16,7 +16,11 @@ respond :give, Query::Reachable.new, Query::Reachable.new do |actor, character,
16
16
  end
17
17
 
18
18
  respond :give, Query::Reachable.new(Character), Query::Children.new do |actor, character, gift|
19
- actor.tell "#{The character} doesn't want #{the gift}."
19
+ if gift.sticky?
20
+ actor.tell gift.sticky_message || "#{you.pronoun.Subj} #{you.verb.need} to keep #{the gift} for now."
21
+ else
22
+ actor.tell "#{The character} doesn't want #{the gift}."
23
+ end
20
24
  end
21
25
 
22
26
  respond :give, Query::Text.new, Query::Children.new do |actor, character, gift|
@@ -5,9 +5,13 @@ respond :insert, Use.visible, Use.reachable do |actor, thing, target|
5
5
  end
6
6
 
7
7
  respond :insert, Use.visible, Use.reachable(Receptacle) do |actor, thing, receptacle|
8
- if actor.auto_takes?(thing)
9
- actor.tell "#{you.pronoun.Subj} put #{the thing} in #{the receptacle}."
10
- thing.parent = receptacle
8
+ if thing.sticky?
9
+ actor.tell thing.sticky_message || "#{you.pronoun.Subj} #{you.verb.need} to keep #{the thing} for now."
10
+ else
11
+ if actor.auto_takes?(thing)
12
+ actor.tell "#{you.pronoun.Subj} put #{the thing} in #{the receptacle}."
13
+ thing.parent = receptacle
14
+ end
11
15
  end
12
16
  end
13
17
 
@@ -12,8 +12,12 @@ respond :place, Use.visible, Use.reachable(Supporter) do |actor, thing, supporte
12
12
  end
13
13
 
14
14
  respond :place, Use.children, Use.reachable(Supporter) do |actor, thing, supporter|
15
- thing.parent = supporter
16
- actor.tell "#{you.pronoun.Subj} #{you.verb.put} #{the thing} on #{the supporter}."
15
+ if thing.sticky?
16
+ actor.tell thing.sticky_message || "#{you.pronoun.Subj} #{you.verb.need} to keep #{the thing} for now."
17
+ else
18
+ thing.parent = supporter
19
+ actor.tell "#{you.pronoun.Subj} #{you.verb.put} #{the thing} on #{the supporter}."
20
+ end
17
21
  end
18
22
 
19
23
  respond :place, Use.visible, Use.text do |actor, thing, supporter|
@@ -1,6 +1,11 @@
1
1
  module Gamefic::Portable
2
2
  attr_writer :portable
3
+ attr_writer :sticky
4
+ attr_accessor :sticky_message
3
5
  def portable?
4
6
  @portable ||= false
5
7
  end
8
+ def sticky?
9
+ @sticky ||= false
10
+ end
6
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-26 00:00:00.000000000 Z
11
+ date: 2017-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic