summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorItemReplacer.h
blob: 5a45a830b5d36951be55f5ed16646dfd5b94e0c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once


class cBehaviorItemReplacer;

#include "Behavior.h"

/** When right clicked while holding a_OriginalItem, a mob having this behavior replaces the original item
with a_NewItem. This is used for milking cows.

Connections to other behaviors:
 - None.

Special connections:
 - None.

*/
class cBehaviorItemReplacer : public cBehavior
{

public:
	cBehaviorItemReplacer(short a_OriginalItem, short a_NewItem);
	void AttachToMonster(cMonster & a_Parent);
	void OnRightClicked(cPlayer & a_Player) override;
private:
	// Our parent
	cMonster * m_Parent;
	short m_OriginalItem; // Replace this item with NewItem
	short m_NewItem;
};