cWitherSkullEntity::cWitherSkullEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed) :
	super(pkWitherSkull, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25)
{
	SetSpeed(a_Speed);
	SetGravity(0);
	SetAirDrag(0);
}
Beispiel #2
0
cFireChargeEntity::cFireChargeEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed) :
	super(pkFireCharge, a_Creator, a_X, a_Y, a_Z, 0.3125, 0.3125)
{
	SetSpeed(a_Speed);
	SetGravity(0);
	SetAirDrag(0);
}
Beispiel #3
0
cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) :
	super(a_EntityType, 0, 0, 0, a_Width, a_Height)
	, m_EntityEffects(tEffectMap())
{
	SetGravity(-32.0f);
	SetAirDrag(0.02f);
}
Beispiel #4
0
cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) :
	super(etTNT, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.98),
	m_FuseTicks(a_FuseTicks)
{
	SetGravity(-16.0f);
	SetAirDrag(0.4f);
}
Beispiel #5
0
cChicken::cChicken(void) :
	super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.4, 0.7),
	m_EggDropTimer(0)
{
	SetGravity(-2.0f);
	SetAirDrag(0.0f);
}
Beispiel #6
0
cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) :
	super(a_EntityType, 0, 0, 0, a_Width, a_Height),
	m_EntityEffects(tEffectMap()),
	m_LastGroundHeight(0),
	m_bTouchGround(false)
{
	SetGravity(-32.0f);
	SetAirDrag(0.02f);
}
Beispiel #7
0
cFallingBlock::cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) :
	super(etFallingBlock, a_BlockPosition.x + 0.5f, a_BlockPosition.y + 0.5f, a_BlockPosition.z + 0.5f, 0.98, 0.98),
	m_BlockType(a_BlockType),
	m_BlockMeta(a_BlockMeta),
	m_OriginalPosition(a_BlockPosition)
{
	SetGravity(-16.0f);
	SetAirDrag(0.02f);
}
Beispiel #8
0
cBoat::cBoat(double a_X, double a_Y, double a_Z) :
	super(etBoat, a_X, a_Y, a_Z, 0.98, 0.7)
{
	SetMass(20.0f);
	SetGravity(-16.0f);
	SetAirDrag(0.05f);
	SetMaxHealth(6);
	SetHealth(6);
}
cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, const Vector3d & a_Pos, const Vector3d & a_Speed, double a_Width, double a_Height) :
    super(etProjectile, a_Pos.x, a_Pos.y, a_Pos.z, a_Width, a_Height),
    m_ProjectileKind(a_Kind),
    m_CreatorData(a_Creator->GetUniqueID(), a_Creator->IsPlayer() ? static_cast<cPlayer *>(a_Creator)->GetName() : "", a_Creator->GetEquippedWeapon().m_Enchantments),
    m_IsInGround(false)
{
    SetSpeed(a_Speed);
    SetYawFromSpeed();
    SetPitchFromSpeed();
    SetGravity(-12.0f);
    SetAirDrag(0.01f);
}
cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, double a_Width, double a_Height) :
    super(etProjectile, a_X, a_Y, a_Z, a_Width, a_Height),
    m_ProjectileKind(a_Kind),
    m_CreatorData(
        ((a_Creator != nullptr) ? a_Creator->GetUniqueID() : cEntity::INVALID_ID),
        ((a_Creator != nullptr) ? (a_Creator->IsPlayer() ? static_cast<cPlayer *>(a_Creator)->GetName() : "") : ""),
        ((a_Creator != nullptr) ? a_Creator->GetEquippedWeapon().m_Enchantments : cEnchantments())
    ),
    m_IsInGround(false)
{
    SetGravity(-12.0f);
    SetAirDrag(0.01f);
}
Beispiel #11
0
cPickup::cPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, bool IsPlayerCreated, float a_SpeedX /* = 0.f */, float a_SpeedY /* = 0.f */, float a_SpeedZ /* = 0.f */)
	: cEntity(etPickup, a_PosX, a_PosY, a_PosZ, 0.2, 0.2)
	, m_Timer(0)
	, m_Item(a_Item)
	, m_bCollected(false)
	, m_bIsPlayerCreated(IsPlayerCreated)
{
	SetGravity(-16.0f);
	SetAirDrag(0.02f);
	SetMaxHealth(5);
	SetHealth(5);
	SetSpeed(a_SpeedX, a_SpeedY, a_SpeedZ);
}
Beispiel #12
0
cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
	super(etMinecart, a_X, a_Y, a_Z, 0.98, 0.7),
	m_Payload(a_Payload),
	m_LastDamage(0),
	m_DetectorRailPosition(0, 0, 0),
	m_bIsOnDetectorRail(false)
{
	SetMass(20.0f);
	SetGravity(-16.0f);
	SetAirDrag(0.05f);
	SetMaxHealth(6);
	SetHealth(6);
	SetWidth(1);
	SetHeight(0.9);
}
Beispiel #13
0
cArrowEntity::cArrowEntity(cPlayer & a_Player, double a_Force) :
	super(pkArrow, &a_Player, a_Player.GetThrowStartPos(), a_Player.GetThrowSpeed(a_Force * 1.5 * 20), 0.5, 0.5),
	m_PickupState(psInSurvivalOrCreative),
	m_DamageCoeff(2),
	m_IsCritical((a_Force >= 1)),
	m_Timer(0),
	m_HitGroundTimer(0),
	m_HasTeleported(false),
	m_bIsCollected(false),
	m_HitBlockPos(0, 0, 0)
{
	if (a_Player.IsGameModeCreative())
	{
		m_PickupState = psInCreative;
	}
	SetGravity(-20.0f);
	SetAirDrag(0.01f);
}
Beispiel #14
0
cArrowEntity::cArrowEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed) :
	super(pkArrow, a_Creator, a_X, a_Y, a_Z, 0.5, 0.5),
	m_PickupState(psNoPickup),
	m_DamageCoeff(2),
	m_IsCritical(false),
	m_Timer(0),
	m_HitGroundTimer(0),
	m_HasTeleported(false),
	m_bIsCollected(false),
	m_HitBlockPos(Vector3i(0, 0, 0))
{
	SetSpeed(a_Speed);
	SetMass(0.1);
	SetGravity(-20.0f);
	SetAirDrag(0.2f);
	SetYawFromSpeed();
	SetPitchFromSpeed();
	LOGD("Created arrow %d with speed {%.02f, %.02f, %.02f} and rot {%.02f, %.02f}",
		m_UniqueID, GetSpeedX(), GetSpeedY(), GetSpeedZ(),
		GetYaw(), GetPitch()
	);
}
Beispiel #15
0
cBlaze::cBlaze(void) :
	super("Blaze", mtBlaze, "mob.blaze.hit", "mob.blaze.death", 0.6, 1.8)
{
	SetGravity(-8.0f);
	SetAirDrag(0.05f);
}
Beispiel #16
0
cBat::cBat(void) :
	super("Bat", mtBat,  "mob.bat.hurt", "mob.bat.death", 0.5, 0.9)
{
	SetGravity(-2.0f);
	SetAirDrag(0.05f);
}