From 439b3304f4c82448b0e1585f8641503691212cac Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Fri, 22 Jan 2016 20:55:46 +0200 Subject: Improved tamed wolf pack cooperation and projectile reactions --- src/Mobs/Wolf.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/Mobs/Wolf.h') 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; } ; -- cgit v1.2.3