This commit is contained in:
scientiist
2020-02-26 18:13:08 -06:00
parent 0f2fc68b80
commit 9171a4c395
9 changed files with 104 additions and 70 deletions

BIN
assets/entities/airship.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

View File

@@ -69,30 +69,6 @@ potion:new("LOWMASS_POTION", {
end,
})
potion:new("ENERGY_DRINK", {
displayname = "YEET(tm) ENERGY DRINK",
color = {1, 1, 0.25},
texture = "fullbottle2.png",
rarity = 4,
tooltip = "\"Not safe for human consumption\"",
consume = function(self, player)
player:addStatusEffect("EXPLOSION", 5)
return true
end,
})
potion:new("LYSERGAMIDE_POTION", {
displayname = "LYSERGAMIDES VIAL",
color = {0.2, 0.8, 1},
texture = "fullbottle2.png",
rarity = 6,
tooltip = "Far-Out Maaan!",
consume = function(self, player)
-- TODO: do this lol
return true
end,
})
potion:new("HEALING_POTION", {
displayname = "GENERIC HEALTH POTION",
color = {1, 0.5, 1},
@@ -107,7 +83,7 @@ potion:new("HEALING_POTION", {
-- TODO: make some new textures for these
potion:new("INSTANT_HP_10", {
displayname = "HP10+ VIAL",
displayname = "INSTANT HEALTH VIAL",
color = {1, 0.2, 0.5},
texture = "fullbottle1.png",
rarity = 1,
@@ -119,7 +95,7 @@ potion:new("INSTANT_HP_10", {
})
potion:new("INSTANT_HP_50", {
displayname = "HP50+ VIAL",
displayname = "INSTANT HEALTH II VIAL",
color = {1, 0.5, 1},
texture = "fullbottle1.png",
rarity = 1,

View File

@@ -6,4 +6,10 @@ local s = function(re, pr)
recipe("alchemylab", {re}, {pr})
end
r({{"BOTTLE", 3}, {"CRYING_LILY", 1}}, {{"MANLET_POTION", 3}})
r({{"BOTTLE", 3}, {"CRYING_LILY", 1}}, {{"MANLET_POTION", 3}})
r({{"BOTTLE", 3}, {"MUSHROOM_PSILOCYN", 1}}, {{"GLOWING_POTION", 3}})
r({{"BOTTLE", 3}, {"BAMBOO_TILE", 1}, {"GOLD_ORE_TILE", 1}}, {{"SPEED_POTION", 3}})
r({{"BOTTLE", 3}, {"CLOUD_TILE", 2}}, {{"LOWMASS_POTION", 3}})
r({{"BOTTLE", 3}, {"MUSHROOM", 1}, {"SILVER_ORE_TILE", 3}}, {{"HEALING_POTION", 3}})
r({{"BOTTLE", 3}}, {{"INSTANT_HP_10", 3}})
r({{"BOTTLE", 3}}, {{"INSTANT_HP_50", 3}})

50
src/entities/boss.lua Normal file
View File

@@ -0,0 +1,50 @@
local guiutil = require("src.guiutil")
local physicalentity = require("src.entities.physicalentity")
local boss = physicalentity:subclass("Boss")
function boss:init()
physicalentity.init(self)
self.mass = 0
self.xfriction = 1
self.noclip = true
self.apply_gravity = false
self.boss_title = "boss"
end
function boss:update(dt)
physicalentity.update(self, dt)
end
function boss:draw()
physicalentity.draw(self)
-- TODO: draw boss healthbar
love.graphics.push()
love.graphics.origin()
love.graphics.setFont(guiutil.fonts.font_20)
love.graphics.setColor(1,1,1)
love.graphics.printf(self.boss_title, 0, 10, love.graphics.getWidth(), "center")
love.graphics.setColor(1, 0, 0)
love.graphics.rectangle("fill",
80, 40, love.graphics.getWidth()-160, 20
)
love.graphics.setColor(0, 1, 0)
love.graphics.rectangle("fill",
80, 40, (love.graphics.getWidth()-160)*(self.health/self.maxhealth), 20
)
love.graphics.setColor(1,1,1)
love.graphics.printf(self.health.."/"..self.maxhealth, 0, 40, love.graphics.getWidth(), "center")
love.graphics.pop()
end
return boss

View File

@@ -0,0 +1,33 @@
local jutils = require("src.jutils")
local boss = require("src.entities.boss")
local zeppelin_texture = love.graphics.newImage("assets/entities/airship.png")
local zeppelin = boss:subclass("Zeppelin")
function zeppelin:init()
boss.init(self)
self.texture = zeppelin_texture
self.boundingbox = jutils.vec2.new(96, 30)
self.textureorigin = jutils.vec2.new(96, 30)
self.boss_title = "Led Zeppelin"
self.health = 500
self.maxhealth = 500
end
function zeppelin:update(dt)
boss.update(self, dt)
end
function zeppelin:draw()
boss.draw(self)
love.graphics.setColor(1,1,1)
love.graphics.draw(self.texture,
self.position.x, self.position.y, self.rotation,
self.scale.x, self.scale.y,
self.textureorigin.x, self.textureorigin.y
)
end
return zeppelin

View File

@@ -6,56 +6,21 @@ local zombie = humanoid:subclass("Zombie")
local badguytexture = love.graphics.newImage("assets/entities/badguy.png")
local zombie_types = {
[1] = {
health = 50,
scale = 1.3,
xfriction = 0.15,
boundingbox = jutils.vec2.new(8, 16)
},
[2] = {
health = 35,
scale = 1.1,
xfriction = 0.135,
boundingbox = jutils.vec2.new(8, 16)
},
[3] = {
health = 30,
scale = 1.0,
xfriction = 0.125,
boundingbox = jutils.vec2.new(7, 14)
},
[4] = {
health = 20,
scale = 0.9,
xfriction = 0.1,
boundingbox = jutils.vec2.new(6, 12)
},
[5] = {
health = 15,
scale = 0.8,
xfriction = 0.10,
boundingbox = jutils.vec2.new(5, 10)
}
}
function zombie:init()
humanoid.init(self)
local ztype = zombie_types[math.random(#zombie_types)]
self.scale = jutils.vec2.new(ztype.scale, ztype.scale)
self.scale = jutils.vec2.new(1, 1)
self.displayname = "Zombie"
self.hurt_yell_pitch = 0.75
self.texture = badguytexture
self.textureorigin = jutils.vec2.new(8, 12)
self.boundingbox = ztype.boundingbox
self.boundingbox = jutils.vec2.new(6, 12)
self.fallthrough = true
self.mass = 1.25
self.maxhealth = ztype.health
self.health = ztype.health
self.maxhealth = 25
self.health = 25
self.walkspeed = 30
self.xfriction = ztype.xfriction
self.xfriction = 0.1
self.direction = -1
self.acceleration = 120
self.attackCooldown = 0

View File

@@ -52,7 +52,9 @@ local entitylist = {
arrow = require("src.entities.projectiles.arrow"),
flamingarrow = require("src.entities.projectiles.flamingarrow"),
-- balls
laser = require("src.entities.projectiles.laser"),
laser = require("src.entities.projectiles.laser"),
-- bosses
zeppelin = require("src.entities.hostile.zeppelin")
}
local channels = {

View File

@@ -60,7 +60,6 @@ local function saveChunkToFile(key, chunk)
if #serialized > 0 then
local success, err = love.filesystem.write("worlds/"..worldname.."/chunks/"..key, serialized)
if not success then
print("error saving chunk:", err)
error("error saving chunk")

View File

@@ -6,4 +6,7 @@ Snow biome
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
Make backgrounds load from data folder
* take fall damage when under effect of low mass potion
* item hoppers
* lua computers?