riftlurker / open-screeps Goto Github PK
View Code? Open in Web Editor NEW:construction: reusable and tested building blocks for every screeps code base :construction:
License: MIT License
:construction: reusable and tested building blocks for every screeps code base :construction:
License: MIT License
I was thinking of making a few modules:
creep-has-bodypart
- does the given creep have the given body partcreep-count-bodypart
- how many of the body part does the creep haveis-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 0The 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 #16I'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:
creep1
which has:
fatigue
: 1carry.energy
: 100carry.power
: 200spawning
: truemove()
alwayrs returns ERR_TIREDgetLinearDistance
It would then be usable by players to do testing in their own AI and us in open-screeps packages.
In order to create consistent code it's a good idea to setup a code style check to the workflow.
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.
In npm the license currently links to https://github.com/postcrafter/open-screeps/license.md
which results in a 404 error.
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)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.