Commit Graph

20 Commits

Author SHA1 Message Date
David Leal a8daa417c4
Add GitHub workflow and luacheck (#545)
Add badge to README
Fix luacheck warnings
Remove node_ownership globals (and support)
2020-06-12 20:39:00 +02:00
David Leal d5df30c3ff Replace deprecated functions with newer ones (#510)
Use mod.conf
2019-09-14 12:55:41 +02:00
Christopher Head 4f78a69ffc Fix trailing whitespace (#482)
Trim all trailing whitespace characters,
2019-01-26 14:15:40 +01:00
Vanessa Ezekowitz 71b13ab0e8 tile_images --> tiles 2015-10-23 14:15:48 -04:00
MT-Modder b8c9028681 Tools don't wear in creative mode v2
- Removed cans (will add again per request)
- Added creative check to global namespace (checking only once as
requested by VanessaE)
2015-03-11 18:08:16 -04:00
ShadowNinja 87fc21443c Add hack for uninitialized players in flashlight 2014-07-21 00:14:55 -04:00
Zefram 00d7c9bdea Refill behaviour for power tools and cans
Supply the on_refill hook for power tools and cans, to perform appropriate
charging.  This is to be used by unified_inventory's creative-mode
refill slot.
2014-04-30 10:49:54 +01:00
Zefram 99fd5dfee5 Genericise handling of multiple meanings of wear
The tool workshop is meant to repair mechanical damage to tools, so
is at risk of `repairing' tools that use the wear bar to represent
something other than mechanical wear.  It had special-case recognition
of the water and lava cans, which use the wear bar to represent how much
content they're carrying, and wouldn't repair them.  But it didn't avoid
`repairing' RE chargeable items, which use the wear bar to represent
how much energy they have stored.  It would modify the wear bar without
actually affecting the charge, so the wear bar would jump back to the
correct place when the next charging or discharging event occurred.

To genericise, introduce a new item property, "wear_represents", which
indicates how the wear bar is used for this item.  Currently defined
values are "mechanical_wear" (straightforward damage to tools that
start out perfect), "technic_RE_charge" (electrical energy, canonically
represented in the meta rather than the wear bar), and "content_level"
(how full a container is).  For backcompat, nil is interpreted as
"mechanical_wear".  The tool workshop will only repair "mechanical_wear"
tools.  As a bonus, set_RE_wear() will only set the wear bar for
"technic_RE_charge" items: this means developers will notice if they
forget to declare wear_represents, but also means that with no further
changes it's possible to have an RE chargeable item that uses its wear
bar to represent something else.
2014-04-30 00:21:55 +01:00
Zefram 70fb21ef36 Fix search for operating flashlight
Having a never-charged flashlight in the hotbar earlier than a charged
flashlight prevented the charged flashlight being found.
2014-04-27 14:43:31 -04:00
Zefram 5c59d97070 Fix discharge of flashlight and sonic screwdriver
These two tools wouldn't discharge all the way to zero through use,
unlike most chargeable items.

Incidentally remove a duplicate of the check_for_flashlight() function.
2014-04-27 14:43:31 -04:00
Zefram db79675570 Fix flashlight's light generation
The flashlight was lighting the wrong node, 1 m east of the player's lower
half, thus getting no light if the player is adjacent to an eastern wall.
Restore the old 1 m above, that coincides with the player's hands.

There was a problem with light from the flashlight getting stuck in
the map.  This arises because the flashlight's light value was 15, the
reserved value that the engine uses for sunlight.  Moving the flashlight
upwards, by jumping while it is equipped, would cause the node below it to
acquire a bogus sunlit state.  Fix this by reducing the flashlight's light
value to 14 (LIGHT_MAX), which is the maximum permitted for non-sunlight.

The light_off node type is not required.  With the light value limited
to 14, mere removal of the light node suffices to correctly recalculate
lighting.
2014-04-27 14:43:31 -04:00
Zefram 60c75bce74 Fix flashlight light node declarations
The light and light_off node types should be not_in_creative_inventory,
and should drop nothing.
2014-04-27 14:43:31 -04:00
ShadowNinja dd2962aba6 Rewrite flashlight 2013-12-17 19:57:24 -05:00
ShadowNinja d8437faebc More global localiztions 2013-12-17 19:56:01 -05:00
ShadowNinja 5cf765b2f1 Localize most variables 2013-12-17 13:56:37 -05:00
ShadowNinja be2f30a1a2 Add support for translations via intllib 2013-10-30 13:48:39 -04:00
ShadowNinja eac4844175 Fix negative tool discharging and a few other tweaks...
Disable the flashlight by default.
Use itemstack:{get,set}_{metadata,name,wear,...} rather than {to,from}_table.
Improve the style of part of the code of mischelaneous tools
2013-10-18 22:28:32 -04:00
ShadowNinja ee0765804c Partial rewrite 2013-09-17 16:37:56 -04:00
RealBadAngel 3bc6cad671 Remove lv, mv, and hv tiers from power tools.
Theyre already tiered with Mk1-3 (at least drill is, more in the future).
Tools can be considered as designed for different tiers of circuits thx to their power needs.
For example Mk3 will require ages to load in LV batbox.
Batboxes load tools timining: LV standard (1000EU), MV 4x faster (4000EU), HV 16x faster (16000EU)
Also since 1EU is the same in any circuit it is possible to move energy from one to another with portable devices like crystals.

Other changes:
- moved charge/discharge functions to battery_boxes_commons.lua
- added UI style backgrounds for all the batboxes
2013-07-17 19:14:01 +02:00
ShadowNinja 5d470cd753 Move files to subfolders 2013-07-11 12:31:00 -04:00