local npcManager = require("npcManager")
local npcutils = require("npcs/npcutils")

local battleBombs = require("scripts/battleBombs")

local onlinePlayNPC = require("scripts/onlinePlay_npc")


local bomb = {}
local npcID = NPC_ID

local bombSettings = {
	id = npcID,

	gfxwidth = 48,
	gfxheight = 48,

	width = 24,
	height = 24,

	gfxoffsetx = 0,
	gfxoffsety = 2,

	frames = 3,
	framestyle = 0,
	framespeed = 4,

	luahandlesspeed = true,
	nowaterphysics = false,
	cliffturn = false,
	staticdirection = false,

	npcblock = false,
	npcblocktop = false,
	playerblock = false,
	playerblocktop = true,

	nohurt = true,
	nogravity = false,
	noblockcollision = false,
	notcointransformable = false,
	nofireball = false,
	noiceball = true,
	noyoshi = false,

	jumphurt = false,
	spinjumpsafe = false,
	harmlessgrab = false,
	harmlessthrown = false,
	nowalldeath = false,

	linkshieldable = false,
	noshieldfireeffect = false,

	grabside = true,
	grabtop = true,

	isstationary = true,


	explosionID = Explosion.register(104,113,43,false,true),
	explosionEffectRadius = 128,

	flashColor = Color.fromHexRGB(0xF8B870),
	flashExtremity = 0.5,
	flashFadeTime = 50,
	flashStartTime = 100,

	fuseDuration = 350,
}

npcManager.setNpcSettings(bombSettings)
npcManager.registerHarmTypes(npcID,
	{
		HARM_TYPE_JUMP,
		HARM_TYPE_FROMBELOW,
		HARM_TYPE_NPC,
		HARM_TYPE_PROJECTILE_USED,
		HARM_TYPE_LAVA,
		HARM_TYPE_HELD,
		HARM_TYPE_TAIL,
		HARM_TYPE_SPINJUMP,
		HARM_TYPE_OFFSCREEN,
		HARM_TYPE_SWORD
	}, 
	{
		[HARM_TYPE_LAVA] = {id=13, xoffset=0.5, xoffsetBack = 0, yoffset=1, yoffsetBack = 1.5},
		[HARM_TYPE_SPINJUMP] = 10,
	}
)


battleBombs.mainNPCID = npcID
battleBombs.stashableNPCIDMap[npcID] = true

battleBombs.register(npcID)


return bomb