Revert "mess"

This reverts commit ee5eb93a6e.
This commit is contained in:
scientiist
2020-04-23 00:56:05 -05:00
parent ee5eb93a6e
commit 6955a2ea8c
7 changed files with 55 additions and 73 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -224,23 +224,6 @@ armour_item:new("WITCH_DRESS_BOTTOM", {
leggings = true,
})
armour_item:new("THERMAL_HOOD", {
helmet = true,
tick = function(self, player, dt)
end
})
armour_item:new("THERMAL_JACKET", {
tick = function(self, player, dt)
end,
})
armour_item:new("THERMAL_PANTS", {
})
baseitem:new("BART", {
accessory = true,
})
@@ -318,6 +301,10 @@ baseitem:new("SHOE_SPIKES", {
end,
})
--[[
TODO: a jump debounce like in terraria. to make this shit feel much nicer and fun to use.
getting kinda tired. think i'll stop for now.
]]
baseitem:new("JETPACK", {
displayname = "JETPACK",
texture = "jetpack.png",
@@ -325,39 +312,21 @@ baseitem:new("JETPACK", {
stack = 1,
tick = function(self, player, dt)
if player.jetpack_enabled then
if player.jumping then
player.jetpack_power = player.jetpack_power - dt
if player.velocity.y > -150 and player.jetpack_power > 0 then
player.velocity.y = player.velocity.y - (900*dt)
end
if player.jumping then
player.jetpack_power = player.jetpack_power - dt
if player.velocity.y > -150 and player.jetpack_power > 0 then
player.velocity.y = player.velocity.y - (900*dt)
end
end
if player.falling == false then
player.jetpack_enabled = false
elseif player.falling == false then
player.jetpack_power = 2
end
end,
keyPress = function(self, player, key)
if key == "space" then
if player.falling then
player.jetpack_enabled = true
player.jetpack_power = 2
end
end
end,
})
-- TODO: make onEquip callback run for equipped items when the game starts
baseitem:new("SPEED_SHOES", {
onEquip = function(self, player)
player.walkspeed = player.walkspeed + 50
player.acceleration = player.acceleration + 1000
end,
onUnequip = function(self, player)
player.walkspeed = player.walkspeed - 50
player.acceleration = player.acceleration - 1000
end,
accessory = true,
stack = 1,
})

View File

@@ -125,7 +125,6 @@ local references = {
wire = tileQuad(1, 7),
wire_base = tileQuad(2, 7),
switch = tileQuad(2, 6),
pump = tileQuad(3, 6),
anvil_1_1 = tileQuad(8, 7),
anvil_2_1 = tileQuad(9, 7),

View File

@@ -788,34 +788,56 @@ newtile("BUFFER", {
})
local function pump_search(world, x, y)
for dx = -20, 20 do
for dy = -20, 20 do
if dx ~= 0 and dy ~= 0 then
if world:getTile(x+dx, y+dy) == tilelist.PUMP.id then
if world:getTileState(x+dx, y+dy) == 1 then
for cy = 0, 10 do
if world:getTile(x+dx, y+dy-cy) == tilelist.AIR.id then
world:setTile(x+dx, y+dy-cy, tilelist.WATER.id)
return true
end
end
end
end
end
end
end
return false
end
newtile("PUMP", {
texture = "pump",
tileupdate = function(world, x, y)
local state = world:getTileState(x, y)
if state == 1 then
local tile_below = world:getTile(x, y+1)
local water_left = (world:getTile(x-1, y) == tilelist.WATER.id)
local water_right = (world:getTile(x+1, y) == tilelist.WATER.id)
local water_below = (world:getTile(x, y+1) == tilelist.WATER.id)
local water_above = (world:getTile(x, y-1) == tilelist.WATER.id)
local water_below = (tile_below == tilelist.WATER.id)
local lava_below = (tile_below == tilelist.LAVA.id)
local blood_below = (tile_below == tilelist.BLOOD.id)
local air_above = (world:getTile(x, y-1) == tilelist.AIR.id)
if air_above then
if water_below then
world:setTile(x, y+1, tilelist.AIR.id)
world:setTile(x, y-1, tilelist.WATER.id)
if water_left then
local found = pump_search(world, x, y)
if found then
world:setTile(x-1, y, tilelist.AIR.id)
end
if blood_below then
world:setTile(x, y+1, tilelist.AIR.id)
world:setTile(x, y-1, tilelist.BLOOD.id)
elseif water_right then
local found = pump_search(world, x, y)
if found then
world:setTile(x+1, y, tilelist.AIR.id)
end
if lava_below then
elseif water_below then
local found = pump_search(world, x, y)
if found then
world:setTile(x, y+1, tilelist.AIR.id)
world:setTile(x, y-1, tilelist.LAVA.id)
end
elseif water_above then
local found = pump_search(world, x, y)
if found then
world:setTile(x, y-1, tilelist.AIR.id)
end
end
@@ -823,4 +845,4 @@ newtile("PUMP", {
world:setTileState(x, y, 0)
end
end,
})
})

View File

@@ -3,9 +3,6 @@ local physicalentity = require("src.entities.physicalentity")
local tiles = require("src.tiles")
local jutils = require("src.jutils")
local glowstick_texture = love.graphics.newImage("assets/items/glowstick.png")
local glowstick = projectile:subclass("Glowstick")
function glowstick:init(...)
@@ -13,7 +10,7 @@ function glowstick:init(...)
self.lightemitter = {0.25, 1, 0.25}
self.mass = 0.75
self.mass = 0.5
self.xfriction = 0.2
self.save = false
self.boundingbox = jutils.vec2.new(3, 3)

View File

@@ -162,9 +162,6 @@ function world:generate_tile_id_mappings()
for name, data in pairs(backgrounds:getList()) do
map.backgrounds[name] = data.id
end
for name, data in pairs(items:getList()) do
map.items[name] = data.id
end
local data = json.encode(map)
love.filesystem.write("conversionmaps/"..config.DATA_VERSION, data)

View File

@@ -7,10 +7,8 @@ Viking Steel Armour - gives a buff in cold weather
DOOMstick - demonic double barreled upgrade to the boomstick.
Make loottables load from data folder
Make backgrounds load from data folder
* bug: player will take fall damage when under effect of low mass potion
* take fall damage when under effect of low mass potion
* item hoppers
* lua computers?
shoe spikes accessory
jetpack accessory
* glowstick entity needs texture, also tweak properties
* system to keep track of item ids (or eliminate them entirely)
jetpack accessory