cyphesis/rulesets/deeds/world/objects/undead/Skeleton.py
Erik Ogenvik 0572fd6d4a Use "props" to get properties.
Also unify LocatedEntity Python bindings.
2018-05-14 17:35:19 +02:00

22 lines
966 B
Python

#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 1999 Al Riddoch (See the file COPYING for details).
from atlas import *
from common import log,const
from physics import Vector3D
from random import *
import server
class Skeleton(server.Thing):
def touch_operation(self, op):
retops = Oplist()
if self.props.status<0: return
newloc=self.location.copy()
newloc.velocity=Vector3D()
retops = retops + Operation("move", Entity(self.id, location=newloc.copy(), mode="collapsed"), to=self)
for item in ['skull', 'ribcage', 'femur', 'pelvis', 'tibia']:
newloc.coordinates = newloc.coordinates + Vector3D(uniform(-1,1), uniform(-1,1), uniform(-1,1))
retops = retops + Operation("create", Entity(name=item,parent=item,location=newloc.copy()), to=self)
retops = retops + Operation("set", Entity(self.id, status=-1), to=self)
return retops