Crossfire Server, Trunk
dragon_attune.py
Go to the documentation of this file.
1 # dragon_attune.py
2 #
3 # Copyright 2008 by Lalo Martins
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #
19 #
20 #
21 # This script sets the metabolism for a player dragon.
22 # It's meant to be run by the player changers in the hall of selection.
23 
24 import Crossfire, os
25 animations = {
26  2: 'pl_dragon_r',
27  3: 'pl_dragon_blue',
28  4: 'pl_dragon_bl',
29  10: 'pl_dragon_g',
30 }
31 faces = {
32  2: 'pl_dragon_r.171',
33  3: 'pl_dragon_blue.171',
34  4: 'pl_dragon_bl.132',
35  10: 'pl_dragon_g.132',
36 }
37 
38 changer = Crossfire.WhoAmI()
39 aname = Crossfire.ScriptParameters()
40 atype = getattr(Crossfire.AttackTypeNumber, aname.upper())
41 player = changer
42 while player and player.Archetype.Name != 'pl_dragon':
43  player = player.Above
44 if player:
45  force = player.CheckArchInventory('dragon_ability_force')
46  force.Exp = atype
47  player.Anim = animations[atype]
48  player.Face = faces[atype]
49  player.Title = '%s hatchling' % aname
50  changer.Say("Your metabolism is now focused on me.")