GithubHelp home page GithubHelp logo

riftlurker / open-screeps Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 4.0 61 KB

:construction: reusable and tested building blocks for every screeps code base :construction:

License: MIT License

TypeScript 100.00%
screeps typescript monorepo lerna ava nyc

open-screeps's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

open-screeps's Issues

Creep Modules

I was thinking of making a few modules:

  • creep-has-bodypart - does the given creep have the given body part
  • creep-count-bodypart - how many of the body part does the creep have
  • is-creep-boosted - is the creep boosted. optional param of RESOURCE_* constant for if the creep is boosted with the given boost.
  • is-creep-boosted-count - how many body parts are boosted. optional param of RESOURCE_* constant for if the creep is boosted with the given boost.
  • is-carrying - is the creep carrying the given resource.
  • is-fatigued - is the creeps fatigue higher than 0

Create module `is-room-visible`

The module should return whether the room is currently visible. This can be done by checking whether the roomName exists as a key in Game.rooms.

The following modules could get created with this:

  • is-simulation - check whether the room sim is visible - implemented in #16

Test stubbing package.

I'm repeating myself in a few packages with my stubbings which isn't really necessary.

If we create @open-screeps\tests-stub it could provide:

  • All the constants
  • A selection of creeps e.g:
    • creep1 which has:
      • fatigue: 1
      • carry.energy: 100
      • carry.power: 200
      • body....
      • spawning: true
      • move() alwayrs returns ERR_TIRED
    • etc....
  • A selection of Rooms
  • A copy of functions that dont use storage e.g. getLinearDistance

It would then be usable by players to do testing in their own AI and us in open-screeps packages.

Setup tslint

In order to create consistent code it's a good idea to setup a code style check to the workflow.

  • Install tslint
  • Install and configure tslint-config-airbnb
    • Configure single tab instead of 2 spaces
  • Integrate into the workflow
    • For local execution
    • Into CircleCI execution

Replace yeoman with mrm

The current setup uses yeoman to create new files, which works fine for this exact use case. When changes have to be made to every package (such as in this commit), it doesn't help at all and the tedious changes have to be made manually.
mrm allows us to both generate new files or edit them in place. Changes will have to be made to the general configuration and can be applied and commited for every package afterwards.

Incorrect link to license

In npm the license currently links to https://github.com/postcrafter/open-screeps/license.md which results in a 404 error.

Create module `get-time`

The module should return the current screeps time, this basically comes down to creating a function that returns Game.time.

Benefit of using this module is the separation of concern, if the screeps api were to ever change we can just update this module and everything is sorted.

The following modules should be created alongside this one:

  • is-past - isPast(time)
  • is-present - isPresent(time)
  • is-future - isFuture(time)

Create module `tower-effectiveness-at-range`

  • The module should calculate the effective power a tower can perform at specified range. This is mostly useful for usage along with TOWER_POWER_ATTACK, TOWER_POWER_HEAL or TOWER_POWER_REPAIR.

Optionally create the following modules as well:

  • get-tower-attack-effect - calling get-tower-effect using TOWER_POWER_ATTACK
  • get-tower-heal-effect - calling get-tower-effect using TOWER_POWER_HEAL
  • get-tower-repair-effect - calling get-tower-effect using TOWER_POWER_REPAIR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.