Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gamefic-overlookable

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gamefic-overlookable

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

gamefic-overlookable

A Gamefic library for easy implementation of insignificant entities.

It's good practice to implement nouns that players receive in descriptions, even if they're irrelevant to the game.

Bad:

> look around

You're in a room with four walls.

> examine walls

I recognize "examine" as a verb but don't know what you mean by "walls."

Better:

> examine walls

There's nothing special about the four walls.

The gamefic-overlookable library simplifies the process of creating Scenery entities that provide a default response to unimplemented nouns.

Installation

Add the library to your Gamefic project's Gemfile:

gem 'gamefic-overlookable'

Run bundle install.

Add the requirement to your project's code (typically in main.rb):

require 'gamefic-overlookable'

Usage

Entities gain an overlook method that lets you easily add scenery with a default description.

MyGame.seed do
    @room = make Room, name: 'room', description: "You're in a room with four walls."
    @room.overlook 'four walls'
end
> look around

You're in a room with four walls.

> examine walls

There's nothing special about the four walls.

The overlook method can also accept multiple names:

MyGame.seed do
    @room = make Room, name: 'room', description: 'A room with a tall ceiling and a wooden floor.'
    @room.overlook 'tall ceiling', 'wooden floor'
end

Separate names from synonyms with two slashes:

MyGame.seed do
    @room = make Room, name: 'room', description: 'A room with a tall ceiling and a dark wooden floor.'
    @room.overlook 'ceiling//tall', 'floor//dark wooden'
end

You can also add overlookable entities with the rubble and scenery parameters in make:

make Room, name: 'room', description: 'A room with a tall ceiling.', scenery: ['ceiling//tall']

make Thing, name: 'dining set', description: 'A plate and a fork.', rubble: ['plate', 'fork']

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/castwide/gamefic-overlookable.

FAQs

Package last updated on 07 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc