mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
* rulesets/Python_API.cpp: Change the entity_new constructor used by define world scripts so that it takes an optional "pos" argument rather than the long obsolete "xyz". * rulesets/mason/define_world.py, rulesets/werewolf/define_world.py: Modify the most relevant define_world scripts to use the changed API. * rulesets/basic/mind/goals/common/move.py: Remove a long obsolete commented out debug line.
62 lines
1.7 KiB
Python
62 lines
1.7 KiB
Python
#This file is distributed under the terms of the GNU General Public license.
|
|
#Copyright (C) 1999 Aloril (See the file COPYING for details).
|
|
|
|
from atlas import *
|
|
try:
|
|
from random import *
|
|
except ImportError:
|
|
from whrandom import *
|
|
from mind.panlingua import interlinguish
|
|
il=interlinguish
|
|
from world import probability
|
|
from editor import editor
|
|
import time
|
|
|
|
#goal priority
|
|
#1) eating: certain times
|
|
#2) market/tavern: certain times, certain probability
|
|
#3) sleeping: nights
|
|
#4) chop trees: winter (when not doing anything else)
|
|
#4) other similar tasks: seasonal (-"-)
|
|
|
|
#'Breakfast' goal is type of 'eating'.
|
|
|
|
village_height=0
|
|
gallows_pos=(7,7,village_height)
|
|
|
|
knowledge=[('gallows',gallows_pos)]
|
|
|
|
execute=(il.execute,"elect()")
|
|
|
|
count=[(il.trade,"count_players()"),
|
|
(il.trade,"decount_players()")]
|
|
|
|
hangman_goals=[execute]
|
|
|
|
#observer calls this
|
|
def default(mapeditor):
|
|
# general things
|
|
|
|
m=editor(mapeditor)
|
|
|
|
# a wall around the world, suitable for all games.
|
|
|
|
m.make('wall',type='wall',pos=(-151,-101,village_height),bbox=[1,102,2.5])
|
|
m.make('wall',type='wall',pos=(-151,-101,village_height),bbox=[152,1,2.5])
|
|
m.make('wall',type='wall',pos=(-151,100,village_height),bbox=[152,1,2.5])
|
|
m.make('wall',type='wall',pos=(100,-101,village_height),bbox=[1,102,2.5])
|
|
|
|
m.make('weather',type='weather',desc='object that describes the weather',
|
|
pos=(0,1,0), rain=0.0)
|
|
|
|
# the gallows
|
|
gallows = m.make('gallows', type='gallows', pos=gallows_pos)
|
|
|
|
# the mayor, who runs the game
|
|
mayor=m.make('mayor', type='mayor', pos=(1, 1, village_height))
|
|
|
|
# the hangman, who lynches the villagers
|
|
hangman=m.make('hangman', type='hangman', pos=(5, 5, village_height))
|
|
m.learn(hangman,execute)
|
|
m.know(hangman,knowledge)
|
|
m.own(hangman,gallows)
|