Commit Graph

78 Commits

Author SHA1 Message Date
ShadowNinja 1475ee6e40 Add trace_node_ray_fat and use it for mining lasers
This function includes more nodes, so laser tunnels
aren't always only one node wide.
2016-11-17 11:48:19 -05:00
ShadowNinja cfd4cb7871 Update mining laser particle API usage 2016-11-17 11:48:19 -05:00
ShadowNinja 2b0a283556 Adjust mining laser start offset 2016-11-17 11:48:19 -05:00
NathanSalapat 584cd82b58 Add support for new trees in minetest game 2016-03-20 13:30:18 -04:00
ShadowNinja 85a984982c Cleanup
Changes:
  * Make rayIter a global utility, and use it for radiation too.
  * prettynum -> pretty_num and cleanup.
  * Remove resolve_name/function_exists (unused).
  * Cleanup nuclear reactor code.
2016-03-20 00:02:33 -04:00
RealBadAngel 46f3f8ec7d Add vacuum cleaner tool (by Phvli) 2015-11-28 08:27:22 +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
Tim 72d541a607 add trunks: mod support to the chainsaw 2015-02-06 07:59:51 +01:00
Tim 91e12c41fd fix chainsaw support for default:pinetree 2015-02-05 20:33:11 +01:00
Tim a0cf9eb8f3 replace overlooked latex->rubber furnace recipe with glue as a form of "rubber cement" 2015-01-30 17:50:06 +01:00
Tim 80f79f5e1e remove _sidways moretree trunks from chainsaw, these would be abm-converted before anyone could saw them anyway 2015-01-30 05:09:21 +01:00
Tim e4c34c9c32 allow transformer and chainsaw crafts even if required mesecon modules are not loaded 2015-01-30 05:09:21 +01:00
Tim fe4372649f reuse the new screwdriver code of minetest/minetest_game in adapted form for the sonic screwdriver 2015-01-29 18:38:23 -05:00
Wayward1 9e1c5740d3 Fix support for acacia trees
Just realized I had the wrong item string >.<
2015-01-16 20:08:25 -05:00
Tim 0114feaf04 Add more nodes to the chainsaw 2015-01-12 17:51:55 -05:00
Vanessa Ezekowitz a413904ecd minetest.env:* --> minetest.* 2014-11-30 12:45:42 -05:00
Novatux dd30838245 Add more nodes to chainsaw 2014-11-30 08:28:57 +01:00
ShadowNinja 42d0081367 Replace mining laser ray tracer with a simpler iterable one 2014-09-24 20:32:36 -04:00
HybridDog 4d1f9753e3 update mining lasers 2014-09-16 15:23:46 -04:00
ShadowNinja ec069aa43e Change chainsaw cutting algorithm back to old one
The new algorithm caused horizontal sections of trees to be left, with the
sections above and below them removed.
2014-08-22 20:57:30 -04:00
ShadowNinja 16302cffce Fix chainsaw placing drops and playing sounds at tops of trees 2014-08-22 20:01:15 -04:00
Zefram 78646b2d89 Make tree tap respect item_drop 2014-08-22 14:20:13 +01:00
Zefram 3b16a2858f Revise rules for regenerating latex
To ensure that only rubber tree trunk nodes that are part of trees
regenerate, rather than those that are used as building blocks, check
that they are sufficiently close to rubber tree leaves.  This replaces the
older rule that naturally-grown trunks regenerate (regardless of leaves)
and manually-placed trunks don't (even though manually building a tree
otherwise works).  The detection of manually-placed trunks was in any
case broken for users of moretrees, because that mod fails to set the
flag signalling manual placement.

Incidentally also fix a bug that caused rubber tree branches (horizontal
trunk nodes) to turn vertical when regenerating latex.  Rather than set
the complete node structure, only switch the type name, as does the tree
tap when emptying the node.
2014-08-13 23:13:52 +01:00
Zefram 62e04b9c0d Improved can usage
Make the use of cans more like the digging and placement of ordinary
nodes, and specifically make it much closer to the use of buckets.
The main change is that left-click with a can is now only used to take
liquid; placing liquid is now done with a right-click.  This makes the use
of cans a lot less error-prone, compared to the old scheme of determining
the operation based on the type of node pointed to.  Other changes are
that liquid placement is now permitted to replace any buildable_to node,
and the cans obey node protection.
2014-07-23 20:21:59 +01:00
Zefram 6771ad9d33 Genericise can logic
Factor out the logic common to water and lava cans.  Provide it in the
form of a technic.register_can() function, which can be called by other
mods to register cans for other liquids.
2014-07-23 20:21:59 +01:00
ShadowNinja 87fc21443c Add hack for uninitialized players in flashlight 2014-07-21 00:14:55 -04:00
Zefram 69487e530b Fix drill recipe
It was attempting to get the copper ingot from the wrong mod.
2014-07-14 15:19:02 +02:00
Zefram 871ded6e6a Increase prospector's charge capacity
The low capacity of the prospector turned out to be annoying, while the
other limitations do not substantially detract from fun.  Also adjust
recipe to include a blue energy crystal, to explain the source of the
charge capacity.
2014-07-10 08:56:48 +02:00
Zefram 5e4a87b925 Rework some recipes to use more varied ingredients 2014-07-09 09:17:44 +02:00
Zefram 636b0f20df Handheld prospecting tool
The new tool will say whether a target block type is present in a
specified region, to allow for more targeted digging.  It is deliberately
quite weak, with several limitations: only stores enough charge for a
small number of shots; target can only be set by pointing at an example
node; range is limited; accuracy is less than 100%.  Some of these
limitations should probably be ameliorated, but not entirely eliminated,
in the future when we have a better idea of game balance.

The inventory image is only a placeholder.
2014-07-07 15:15:05 +02:00
ShadowNinja 51c02e9c8a Fix the chainsaw's protection check 2014-06-26 16:53:38 -04:00
ShadowNinja 9019ebe496 Clean up and improve chainsaw 2014-06-26 11:13:30 -04:00
Phvli c636582707 Make sure chainsaw drops appear above ground
A fix for https://github.com/minetest-technic/technic/issues/137
Chainsaw drops are forced to pop above ground. Also, as asl suggested,
they must not end up too high on a ledge or a pillar.

This also cleans up the code style of chainsaw.lua.
2014-06-23 18:36:43 -04:00
Zefram c394984ae5 Handle lag better in drill
If a mining drill is apparently applied to a non-pointable node, do
nothing rather than drilling as normal.  This situation usually arises
from lag, where the news of a node having been drilled didn't reach the
user quickly enough and the user thereby applied the drill twice to the
same node.  The second drill attempt would formerly consume charge and
then find that all the nodes it wanted to dig had already been removed.
2014-06-21 01:22:40 +02:00
Novatux 9181666cdc Chainsaw should dig jungle leaves too. 2014-06-08 09:46:44 +02:00
Zefram 68b7bcc28e split default iron/steel into three metals
Override the default mod's iron/steel substance, replacing it with three
metals: wrought iron (pure iron), carbon steel (iron alloyed with a little
carbon), and cast iron (iron alloyed with lots of carbon).  Wrought iron
is easiest to refine, then cast iron, and carbon steel the most difficult,
matching the historical progression.  Recipes that used default steel are
changed to use one of the three, the choice of alloy for each application
being both somewhat realistic and also matching up with game progression.

The default:steel{_ingot,block} items are identified specifically with
wrought iron.  This makes the default refining recipes work appropriately.
Iron-using recipes defined outside technic are thus necessarily
reinterpreted to use wrought iron, which is mostly appropriate.
Some objects are renamed accordingly.

Rather than use the default steel textures for wrought iron, with technic
providing textures for the other two, technic now provides textures for
all three metals.  This avoids problems that would occur with texture
packs that provide default_steel_{ingot,block} textures that are not
intended to support this wrought-iron/carbon-steel/cast-iron distinction.
A texture pack can provide a distinct set of three textures specifically
for the situation where this distinction is required.

Incidentally make grinding and alloy cooking recipes work correctly when
ingredients are specified by alias.
2014-05-22 20:57:50 +02:00
Novatux ecb53e9717 Mining lasers: don't dig the node the player is in. 2014-05-18 16:11:06 +02:00
asl97 45e1f05ffc Move checking of node that should be ignore above protection checking
firing a laser into a sky while in someone land without hitting anything but air shouldn't get anyone ban
2014-05-06 04:22:51 +02: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 0294fc8f3a various backward-compatibility aliases 2014-04-30 00:26:45 +01:00
Zefram 03a5375e55 Fix can wear following tool workshop change
The cans used set_RE_wear() to manage their wear bars.  As that now only
sets wear for power tools, the cans need a separate function.
2014-04-30 00:22:02 +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
Zefram e748af927a Fix drill charge usage
The drills weren't taking the variable usage cost into account (either
the per-type base cost or the per-mode multiplier) when deciding whether
they have sufficient charge to use.  This could cause them to overshoot in
charge usage, although they would then clamp to zero rather than record
negative charge.  Also, for the Mk1 drill where the cost was assessed
correctly, the drill would refuse to discharge to exactly zero charge.
2014-04-27 14:43:00 -04:00
Zefram 04c6f5bea3 Improve message about drill control
The message to "hold shift" makes an unwarranted assumption about the
user's keybindings.  Messages from the server should refer to a key's
game function, rather than its extragame identity.
2014-04-27 14:42:59 -04:00
asl97 628a18977b Add fir leaves to the chainsaw's timber_nodenames 2014-04-22 16:34:14 -04:00