summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Wolf.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-22 19:55:46 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-22 20:16:27 +0100
commit439b3304f4c82448b0e1585f8641503691212cac (patch)
tree706035da78a49c971f6d3bf3d812582581ce93a4 /src/Mobs/Wolf.h
parentMerge pull request #2894 from LogicParrot/spider (diff)
downloadcuberite-439b3304f4c82448b0e1585f8641503691212cac.tar
cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.gz
cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.bz2
cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.lz
cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.xz
cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.zst
cuberite-439b3304f4c82448b0e1585f8641503691212cac.zip
Diffstat (limited to 'src/Mobs/Wolf.h')
-rw-r--r--src/Mobs/Wolf.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h
index 90d38f15c..70e761469 100644
--- a/src/Mobs/Wolf.h
+++ b/src/Mobs/Wolf.h
@@ -18,6 +18,7 @@ public:
CLASS_PROTODEF(cWolf)
+ void NotifyAlliesOfFight(cPawn * a_Opponent);
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
virtual void OnRightClicked(cPlayer & a_Player) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
@@ -45,13 +46,14 @@ public:
m_OwnerUUID = a_NewOwnerUUID;
}
- /** Notfies the wolf that the player a_Player is being attacked by a_Attacker.
- The wolf will then defend the player by attacking a_Attacker if all these conditions are met:
- - a_Player is the wolf's owner.
- - The wolf is not already attacking a mob.
- - The wolf is not sitting.
- This is called by cPlayer::NotifyFriendlyWolves whenever a player takes or deals damage and a wolf is nearby. */
- void NearbyPlayerIsFighting(cPlayer * a_Player, cPawn * a_Opponent);
+ /** Notfies the wolf of a nearby fight.
+ The wolf may then decide to attack a_Opponent.
+ If a_IsPlayer is true, then the player whose ID is a_PlayerID is fighting a_Opponent
+ If false, then a wolf owned by the player whose ID is a_PlayerID is fighting a_Opponent
+ @param a_PlayerID The ID of the fighting player, or the ID of the owner whose wolf is fighting.
+ @param a_Opponent The opponent who is being faught.
+ @param a_IsPlayerInvolved Whether the fighter a player or a wolf. */
+ void ReceiveNearbyFightInfo(AString a_PlayerID, cPawn * a_Opponent, bool a_IsPlayerInvolved);
virtual void InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
@@ -64,6 +66,7 @@ protected:
AString m_OwnerName;
AString m_OwnerUUID;
int m_CollarColor;
+ int m_NotificationCooldown;
} ;