Let's ring some bells, it'll make it funnier for players to hear those :)
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13515 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
8bc36ef15f
commit
c8f185bb3b
|
@ -0,0 +1,32 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# This script makes players aware of the time, tracking the current time
|
||||
import Crossfire
|
||||
|
||||
def ring_bell():
|
||||
players = Crossfire.GetPlayers()
|
||||
for player in players:
|
||||
if player.Map == None:
|
||||
continue
|
||||
if player.Map.Region == None:
|
||||
continue
|
||||
if player.Map.Region.Name == 'scorn':
|
||||
player.Message("You hear the bells of the various temples of Scorn.")
|
||||
elif player.Map.Region.Name == 'darcap':
|
||||
player.Message("You hear the bell of St Andreas.")
|
||||
elif player.Map.Region.Name == 'navar':
|
||||
player.Message("You hear the bell of all the temples of Navar.")
|
||||
|
||||
dict = Crossfire.GetPrivateDictionary()
|
||||
hour = Crossfire.GetTime()[3]
|
||||
|
||||
if not 'init' in dict.keys():
|
||||
dict['init'] = 1
|
||||
dict['last'] = hour
|
||||
Crossfire.Log(Crossfire.LogDebug, "Bell init")
|
||||
else:
|
||||
last = dict['last']
|
||||
if (hour != last):
|
||||
dict['last'] = hour
|
||||
Crossfire.Log(Crossfire.LogDebug, "Bell ringing")
|
||||
ring_bell()
|
Loading…
Reference in New Issue