home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "item" thing type differentiated from animate thing types.
[plomrogue2-experiments]
/
new
/
plomrogue
/
game.py
diff --git
a/new/plomrogue/game.py
b/new/plomrogue/game.py
index a031406b19e32a36432bea01131df305df0a3c5f..dcc6c3dffd917fc46b257877a0db9cc3982f4d77 100755
(executable)
--- a/
new/plomrogue/game.py
+++ b/
new/plomrogue/game.py
@@
-8,7
+8,7
@@
from plomrogue.mapping import MapHex
from plomrogue.parser import Parser
from plomrogue.io import GameIO
from plomrogue.misc import quote, stringify_yx
from plomrogue.parser import Parser
from plomrogue.io import GameIO
from plomrogue.misc import quote, stringify_yx
-from plomrogue.things import Thing, ThingMonster, ThingHuman
+from plomrogue.things import Thing, ThingMonster, ThingHuman
, ThingItem
@@
-83,7
+83,10
@@
class World(WorldBase):
npc = self.game.thing_types['monster'](self, 1)
npc.position = [random.randint(0, yx[0] -1),
random.randint(0, yx[1] -1)]
npc = self.game.thing_types['monster'](self, 1)
npc.position = [random.randint(0, yx[0] -1),
random.randint(0, yx[1] -1)]
- self.things = [player, npc]
+ item = self.game.thing_types['item'](self, 2)
+ item.position = [random.randint(0, yx[0] -1),
+ random.randint(0, yx[1] -1)]
+ self.things = [player, npc, item]
return 'success'
return 'success'
@@
-107,7
+110,9
@@
class Game:
self.world_type = World
self.world = self.world_type(self)
self.thing_type = Thing
self.world_type = World
self.world = self.world_type(self)
self.thing_type = Thing
- self.thing_types = {'human': ThingHuman, 'monster': ThingMonster}
+ self.thing_types = {'human': ThingHuman,
+ 'monster': ThingMonster,
+ 'item': ThingItem}
def get_string_options(self, string_option_type):
if string_option_type == 'direction':
def get_string_options(self, string_option_type):
if string_option_type == 'direction':