cyphesis/rulesets/mars/world/statistics/Statistics.py
Sean Ryan 5268071494 Cloned minimal ruleset to be mars ruleset.
Minimal will not be changed, it will serve as a barren and
minimalistic ruleset that allows someone to start.  Mars will be
the result of all tutorials applied to minimal.
Also reverted minimal ruleset to use moraf, to avoid additional
requirements.
2012-08-10 01:51:17 -04:00

31 lines
905 B
Python

#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2006 Al Riddoch (See the file COPYING for details).
from random import *
class Statistics(object):
"""A very simple Statistics example."""
def __init__(self, entity=None): pass
# Set it up or sumink
def calc_attack(self):
# print "Request for attack"
return 1
def calc_defence(self):
# print "Request for defence"
return 1
def calc_strength(self):
# print "Request for strength"
if hasattr(self, 'character') and hasattr(self.character, 'mass'):
return self.character.mass
else:
return 0
def set_strength(self, val): pass
# print "Setting strength to %d" % val
attack = property(calc_attack)
defence = property(calc_defence)
strength = property(calc_strength, set_strength)