//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_REDSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_REDSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_ORANGESUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_ORANGESUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_GOLDSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_GOLDSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_PERIDOTSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_PERIDOTSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_SKYSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_SKYSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_PURPLESUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_PURPLESUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_RUSTSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_RUSTSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_TANSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_TANSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_SILVERSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_SILVERSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_BLUESUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_BLUESUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_ROSYSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_ROSYSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_BLACKSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_BLACKSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_GREENSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_GREENSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_COPPERSUPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_COPPERSUPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

//Damage enemies just by running into them
addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.color == SKINCOLOR_HYPER and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

//If you get hurt, don't lose rings, but still lose shields
addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.color == SKINCOLOR_HYPER and not (damagetype&DMG_DEATHMASK)
	and target.player.powers[pw_shield] == SH_NONE
		return true
	end
end, MT_PLAYER)

		addHook("PlayerThink", function(player)
		if player.mo.color == SKINCOLOR_HYPER
		and not (player.mo.state == S_PLAY_STND or player.mo.state == S_PLAY_WAIT)
        local ghost = P_SpawnGhostMobj(player.mo)
		ghost.color = player.mo.color
        ghost.colorized = true
		ghost.fuse = 4
	end
	if player.mo.color == SKINCOLOR_HYPER
	and not player.powers[pw_super]
	player.realmo.eflags = $|MFE_FORCESUPER
	end
	if player.mo.color != SKINCOLOR_HYPER
	player.realmo.eflags = $1 & ~MFE_FORCESUPER
	end
	if player.mo.color == SKINCOLOR_HYPER
	local piss = P_SpawnMobjFromMobj(player.realmo, P_RandomRange(-20, 20) * FRACUNIT, P_RandomRange(-20, 20) * FRACUNIT, P_RandomRange(0, 50) * FRACUNIT, MT_SUPERSPARK)
	piss.color = SKINCOLOR_GOLD
	piss.colorized = true
	end
end)

