annotate src/parpg/behaviours/player.py @ 78:c25c734bd2a7

Modifications to make talking with npcs possible again. Special actions won't work yet though.
author KarstenBock@gmx.net
date Thu, 08 Sep 2011 15:18:39 +0200
parents c3350fc9cd45
children 7cb53edfb95f
rev   line source
55
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
1 # This file is part of PARPG.
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
2
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
3 # PARPG is free software: you can redistribute it and/or modify
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
4 # it under the terms of the GNU General Public License as published by
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
5 # the Free Software Foundation, either version 3 of the License, or
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
6 # (at your option) any later version.
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
7
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
8 # PARPG is distributed in the hope that it will be useful,
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
11 # GNU General Public License for more details.
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
12
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
13 # You should have received a copy of the GNU General Public License
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
15
59
2915dbb60940 Fixed error in setting the initial state of the NPC behaviour
KarstenBock@gmx.net
parents: 55
diff changeset
16 import base
2915dbb60940 Fixed error in setting the initial state of the NPC behaviour
KarstenBock@gmx.net
parents: 55
diff changeset
17 from base import BaseBehaviour
55
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
18
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
19 class PlayerBehaviour (BaseBehaviour):
73
58661f5b2f6b Removed layer as attribute of BaseBehaviour and added it as a parameter to the attachToLayer method.
KarstenBock@gmx.net
parents: 59
diff changeset
20 def __init__(self, parent=None):
58661f5b2f6b Removed layer as attribute of BaseBehaviour and added it as a parameter to the attachToLayer method.
KarstenBock@gmx.net
parents: 59
diff changeset
21 super(PlayerBehaviour, self).__init__()
55
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
22 self.parent = parent
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
23 self.idle_counter = 1
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
24 self.speed = 0
4311a0a5378c Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
25 self.nextAction = None
75
c3350fc9cd45 Added approach functionality to the BaseBehaviour
KarstenBock@gmx.net
parents: 73
diff changeset
26 self.agent = None