This repository has been archived on 2024-12-09. You can view files and clone it, but cannot push or open issues or pull requests.
Mineclonia/mods/ENTITIES/mobs_mc/spider.lua

95 lines
2.6 KiB
Lua
Raw Normal View History

2017-07-05 01:15:46 +00:00
--MCmobs v0.4
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
2017-07-05 01:15:46 +00:00
--###################
--################### SPIDER
--###################
-- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
local spider = {
type = "monster",
2020-04-11 00:46:03 +00:00
spawn_class = "hostile",
2017-07-05 01:15:46 +00:00
passive = false,
docile_by_day = true,
attack_type = "dogfight",
pathfinding = 1,
damage = 2,
2017-07-25 22:26:18 +00:00
reach = 2,
2017-07-05 01:15:46 +00:00
hp_min = 16,
hp_max = 16,
2020-12-06 14:46:42 +00:00
xp_min = 5,
xp_max = 5,
2020-11-09 17:59:08 +00:00
armor = {fleshy = 100, arthropod = 100},
2017-07-05 01:15:46 +00:00
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
textures = {
{"mobs_mc_spider.png^(mobs_mc_spider_eyes.png^[makealpha:0,0,0)"},
},
visual_size = {x=3, y=3},
makes_footstep_sound = false,
sounds = {
2020-12-06 12:31:14 +00:00
random = "mobs_mc_spider_random",
attack = "mobs_mc_spider_attack",
damage = "mobs_mc_spider_hurt",
death = "mobs_mc_spider_death",
-- TODO: sounds: walk
2017-07-05 01:15:46 +00:00
distance = 16,
},
walk_velocity = 1.3,
run_velocity = 2.8,
2017-07-05 01:15:46 +00:00
jump = true,
jump_height = 4,
2017-07-05 01:15:46 +00:00
view_range = 16,
floats = 1,
drops = {
2020-12-23 16:41:42 +00:00
{name = mobs_mc.items.string, chance = 1, min = 0, max = 2, looting = "common"},
{name = mobs_mc.items.spider_eye, chance = 3, min = 1, max = 1, looting = "common", looting_chance_function = function(lvl)
return 1 - 2 / (lvl + 3)
end},
2017-07-05 01:15:46 +00:00
},
specific_attack = { "player", "mobs_mc:iron_golem" },
fear_height = 4,
animation = {
2017-09-13 21:13:47 +00:00
stand_speed = 10,
walk_speed = 25,
run_speed = 50,
stand_start = 20,
stand_end = 40,
walk_start = 0,
walk_end = 20,
run_start = 0,
run_end = 20,
2017-07-05 01:15:46 +00:00
},
}
mobs:register_mob("mobs_mc:spider", spider)
-- Cave spider
local cave_spider = table.copy(spider)
cave_spider.textures = { {"mobs_mc_cave_spider.png^(mobs_mc_spider_eyes.png^[makealpha:0,0,0)"} }
-- TODO: Poison damage
-- TODO: Revert damage to 2
cave_spider.damage = 3 -- damage increased to undo non-existing poison
cave_spider.hp_min = 1
cave_spider.hp_max = 12
cave_spider.collisionbox = {-0.35, -0.01, -0.35, 0.35, 0.49, 0.35}
cave_spider.visual_size = {x=1.66666, y=1.5}
cave_spider.walk_velocity = 1.3
cave_spider.run_velocity = 3.2
2020-12-06 12:31:14 +00:00
cave_spider.sounds = table.copy(spider.sounds)
cave_spider.sounds.base_pitch = 1.25
2017-07-05 01:15:46 +00:00
mobs:register_mob("mobs_mc:cave_spider", cave_spider)
mobs:spawn_specific("mobs_mc:spider", mobs_mc.spawn.solid, {"air"}, 0, 7, 30, 17000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
2017-07-05 01:15:46 +00:00
-- spawn eggs
mobs:register_egg("mobs_mc:spider", S("Spider"), "mobs_mc_spawn_icon_spider.png", 0)
mobs:register_egg("mobs_mc:cave_spider", S("Cave Spider"), "mobs_mc_spawn_icon_cave_spider.png", 0)