Renamed SetWalkSpeed() to SetRelativeWalkSpeed()
This commit is contained in:
parent
d3b8100a7b
commit
38e824dbcf
@ -1636,8 +1636,8 @@ a_Player:OpenWindow(Window);
|
||||
MobTypeToString = { Params = "{{cMonster#MobType|MobType}}", Return = "string", Notes = "(STATIC) Returns the string representing the given mob type ({{cMonster#MobType|mtXXX}} constant), or empty string if unknown type." },
|
||||
MoveToPosition = { Params = "Position", Return = "", Notes = "Moves mob to the specified position" },
|
||||
StringToMobType = { Params = "string", Return = "{{cMonster#MobType|MobType}}", Notes = "(STATIC) Returns the mob type ({{cMonster#MobType|mtXXX}} constant) parsed from the string type (\"creeper\"), or mtInvalidType if unrecognized." },
|
||||
GetWalkSpeed = { Params = "", Return = "number", Notes = "Returns the walk speed of this mob. Standard is 1.0" },
|
||||
SetWalkSpeed = { Params = "number", Return = "", Notes = "Sets the walk speed of this mob. Standard is 1.0" },
|
||||
GetRelativeWalkSpeed = { Params = "", Return = "number", Notes = "Returns the relative walk speed of this mob. Standard is 1.0" },
|
||||
SetRelativeWalkSpeed = { Params = "number", Return = "", Notes = "Sets the relative walk speed of this mob. Standard is 1.0" },
|
||||
},
|
||||
Constants =
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ void cEntityEffectSpeed::OnActivate(cPawn & a_Target)
|
||||
if (a_Target.IsMob())
|
||||
{
|
||||
cMonster * Mob = (cMonster*) &a_Target;
|
||||
Mob->SetWalkSpeed(Mob->GetWalkSpeed() + 0.2 * m_Intensity);
|
||||
Mob->SetRelativeWalkSpeed(Mob->GetRelativeWalkSpeed() + 0.2 * m_Intensity);
|
||||
}
|
||||
else if (a_Target.IsPlayer())
|
||||
{
|
||||
@ -260,7 +260,7 @@ void cEntityEffectSpeed::OnDeactivate(cPawn & a_Target)
|
||||
if (a_Target.IsMob())
|
||||
{
|
||||
cMonster * Mob = (cMonster*) &a_Target;
|
||||
Mob->SetWalkSpeed(Mob->GetWalkSpeed() - 0.2 * m_Intensity);
|
||||
Mob->SetRelativeWalkSpeed(Mob->GetRelativeWalkSpeed() - 0.2 * m_Intensity);
|
||||
}
|
||||
else if (a_Target.IsPlayer())
|
||||
{
|
||||
@ -283,7 +283,7 @@ void cEntityEffectSlowness::OnActivate(cPawn & a_Target)
|
||||
if (a_Target.IsMob())
|
||||
{
|
||||
cMonster * Mob = (cMonster*) &a_Target;
|
||||
Mob->SetWalkSpeed(Mob->GetWalkSpeed() - 0.15 * m_Intensity);
|
||||
Mob->SetRelativeWalkSpeed(Mob->GetRelativeWalkSpeed() - 0.15 * m_Intensity);
|
||||
}
|
||||
else if (a_Target.IsPlayer())
|
||||
{
|
||||
@ -303,7 +303,7 @@ void cEntityEffectSlowness::OnDeactivate(cPawn & a_Target)
|
||||
if (a_Target.IsMob())
|
||||
{
|
||||
cMonster * Mob = (cMonster*) &a_Target;
|
||||
Mob->SetWalkSpeed(Mob->GetWalkSpeed() + 0.15 * m_Intensity);
|
||||
Mob->SetRelativeWalkSpeed(Mob->GetRelativeWalkSpeed() + 0.15 * m_Intensity);
|
||||
}
|
||||
else if (a_Target.IsPlayer())
|
||||
{
|
||||
|
@ -89,7 +89,7 @@ cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString
|
||||
, m_DropChanceBoots(0.085f)
|
||||
, m_CanPickUpLoot(true)
|
||||
, m_BurnsInDaylight(false)
|
||||
, m_WalkSpeed(1.0)
|
||||
, m_RelativeWalkSpeed(1.0)
|
||||
{
|
||||
if (!a_ConfigName.empty())
|
||||
{
|
||||
@ -304,7 +304,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
|
||||
}
|
||||
|
||||
// Apply walk speed:
|
||||
Distance *= m_WalkSpeed;
|
||||
Distance *= m_RelativeWalkSpeed;
|
||||
|
||||
AddSpeedX(Distance.x);
|
||||
AddSpeedZ(Distance.z);
|
||||
|
@ -138,8 +138,8 @@ public:
|
||||
/// Sets whether the mob burns in daylight. Only evaluated at next burn-decision tick
|
||||
void SetBurnsInDaylight(bool a_BurnsInDaylight) { m_BurnsInDaylight = a_BurnsInDaylight; }
|
||||
|
||||
double GetWalkSpeed(void) const { return m_WalkSpeed; } // tolua_export
|
||||
void SetWalkSpeed(double a_WalkSpeed) { m_WalkSpeed = a_WalkSpeed; } // tolua_export
|
||||
double GetRelativeWalkSpeed(void) const { return m_RelativeWalkSpeed; } // tolua_export
|
||||
void SetRelativeWalkSpeed(double a_WalkSpeed) { m_RelativeWalkSpeed = a_WalkSpeed; } // tolua_export
|
||||
|
||||
// Overridables to handle ageable mobs
|
||||
virtual bool IsBaby (void) const { return false; }
|
||||
@ -251,7 +251,7 @@ protected:
|
||||
void HandleDaylightBurning(cChunk & a_Chunk);
|
||||
bool m_BurnsInDaylight;
|
||||
|
||||
double m_WalkSpeed;
|
||||
double m_RelativeWalkSpeed;
|
||||
|
||||
/** Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops*/
|
||||
void AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user