summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Wolf.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-22 20:52:49 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-22 20:52:49 +0100
commit7ba432b338ffa4c448de9d68d0f1b1e0024cd50a (patch)
tree706035da78a49c971f6d3bf3d812582581ce93a4 /src/Mobs/Wolf.h
parentMerge pull request #2894 from LogicParrot/spider (diff)
parentImproved tamed wolf pack cooperation and projectile reactions (diff)
downloadcuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.tar
cuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.tar.gz
cuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.tar.bz2
cuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.tar.lz
cuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.tar.xz
cuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.tar.zst
cuberite-7ba432b338ffa4c448de9d68d0f1b1e0024cd50a.zip
Diffstat (limited to '')
-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;
} ;