コード例 #1
0
ファイル: IGalaxy.py プロジェクト: ospaceteam/outerspace
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.name = ""
     obj.owner = Const.OID_NONE
     obj.x = 0.0
     obj.y = 0.0
     obj.radius = 0.0
     obj.centerWeight = 250.0
     obj.systems = []
     obj.startingPos = []
     obj.numOfStartPos = 0
     obj.timeEnabled = None # none instead of False, to know when first enablement is happening
     obj.timePaused = False # this is only used for player-initiated pause, prevents autoenablement
     obj.creationTurn = 0
     obj.imperator = Const.OID_NONE
     obj.description = ""
     obj.scenario = Const.SCENARIO_NONE
     obj.scenarioData = IDataHolder()
     # electromagnetic radiation
     obj.emrLevel = 1.0
     obj.emrTrend = 1.0
     obj.emrTime = 0
     # galaxy keeps track of it's own time as well (because of pauses)
     obj.galaxyTurn = 0
コード例 #2
0
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.name = ""
     obj.owner = Const.OID_NONE
     obj.x = 0.0
     obj.y = 0.0
     obj.radius = 0.0
     obj.centerWeight = 250.0
     obj.systems = []
     obj.startingPos = []
     obj.numOfStartPos = 0
     obj.timeEnabled = None  # none instead of False, to know when first enablement is happening
     obj.timePaused = False  # this is only used for player-initiated pause, prevents autoenablement
     obj.creationTurn = 0
     obj.imperator = Const.OID_NONE
     obj.description = ""
     obj.scenario = Const.SCENARIO_NONE
     obj.scenarioData = IDataHolder()
     # electromagnetic radiation
     obj.emrLevel = 1.0
     obj.emrTrend = 1.0
     obj.emrTime = 0
     # galaxy keeps track of it's own time as well (because of pauses)
     obj.galaxyTurn = 0
コード例 #3
0
 def init(self, obj):
     IObject.init(self, obj)
     obj.members = []
     #
     obj.relations = {}
     obj.alliance = OID_NONE
     obj.defRelation = REL_NEUTRAL
     obj.relationsCache = {}
コード例 #4
0
ファイル: IAlliance.py プロジェクト: ospaceteam/outerspace
 def init(self, obj):
     IObject.init(self, obj)
     obj.members = []
     #
     obj.relations = {}
     obj.alliance = Const.OID_NONE
     obj.defRelation = Const.REL_NEUTRAL
     obj.relationsCache = {}
コード例 #5
0
ファイル: IPlayer.py プロジェクト: Lukc/ospace-lukc
	def init(self, obj):
		IObject.init(self, obj)
		#
		obj.login = u''
		obj.fullName = u''
		#
		obj.buoys = {}
		obj.alliedBuoys = {}
		obj.planets = []
		obj.fleets = []
		obj.techs = {} # techs and their sublevel
		obj.obsoleteTechs = set()
		obj.rsrchQueue = []
		obj.sciPoints = 0
		obj.effSciPoints = 0
		obj.techLevel = 1
		obj.shipDesigns = {}
		obj.race = "H" # race Bionic, Human, Cyborg
		# bonuses
		obj.prodEff = 1.0
		obj.sciEff = 1.0
		#
		obj.govPwr = 0
		obj.govPwrCtrlRange = 1
		# fleet support
		obj.fleetUpgradePool = 0.0
		obj.fleetUpgradeInProgress = 0
		# production
		obj.prodQueues = [[],[],[],[],[]]
		obj.prodIncreasePool = 0.0
		# diplomacy
		obj.diplomacyRels = {}
		obj.defaultRelation = Rules.defaultRelation
		obj.voteFor = OID_NONE
		obj.governorOf = OID_NONE
		obj.governors = []
		obj.alliance = OID_NONE
		obj.imperator = 0
		# combat
		# anti-small, anti-medium, anti-large, shield generator
		obj.planetWeapons = [None, None, None, None, None]
		#
		obj.staticMap = {}
		obj.dynamicMap = {}
		obj.galaxies = []
		obj.validSystems = []
		#
		obj.stats = IDataHolder()
		obj.stats.type = T_STATS
		obj.timeEnabled = 0
		obj.stratRes = {}
		obj.lastLogin = 0.0
		#
		obj.shipRedirections = {}
		obj.buoys = {}
		#
		obj.clientStats = {}
コード例 #6
0
	def init(self, obj):
		IObject.init(self, obj)
		#
		obj.login = u''
		obj.fullName = u''
		#
		obj.buoys = {}
		obj.alliedBuoys = {}
		obj.planets = []
		obj.fleets = []
		obj.techs = {} # techs and their sublevel
		obj.rsrchQueue = []
		obj.sciPoints = 0
		obj.effSciPoints = 0
		obj.techLevel = 1
		obj.shipDesigns = {}
		obj.race = "H" # race Bionic, Human, Cyborg
		# bonuses
		obj.prodEff = 1.0
		obj.sciEff = 1.0
		#
		obj.govPwr = 0
		obj.govPwrCtrlRange = 1
		# fleet support
		obj.fleetUpgradePool = 0.0
		obj.fleetUpgradeInProgress = 0
		# production
		obj.prodIncreasePool = 0.0
		# diplomacy
		obj.diplomacyRels = {}
		obj.defaultRelation = Rules.defaultRelation
		obj.voteFor = OID_NONE
		obj.governorOf = OID_NONE
		obj.governors = []
		obj.alliance = OID_NONE
		obj.imperator = 0
		# combat
		# anti-small, anti-medium, anti-large, shield generator
		obj.planetWeapons = [None, None, None, None, None]
		#
		obj.staticMap = {}
		obj.dynamicMap = {}
		obj.galaxies = []
		obj.validSystems = []
		#
		obj.stats = IDataHolder()
		obj.stats.type = T_STATS
		obj.timeEnabled = 0
		obj.stratRes = {}
		obj.lastLogin = 0.0
		#
		obj.shipRedirections = {}
		obj.buoys = {}
		#
		obj.clientStats = {}
コード例 #7
0
ファイル: IUniverse.py プロジェクト: Lukc/ospace-lukc
	def init(self, obj):
		IObject.init(self, obj)
		#
		obj.name = "Outer Space"
		obj.turn = 0
		obj.owner = OID_ADMIN
		obj.galaxies = []
		obj.players = []
		# auto loading of galaxies
		obj.galX = 0.0
		obj.galY = 0.0
		obj.galXStep = 100.0
		obj.galYStep = 100.0
		obj.galFilename = ''
		obj.galID = ''
コード例 #8
0
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.name = "Outer Space"
     obj.turn = 0
     obj.owner = OID_ADMIN
     obj.galaxies = []
     obj.players = []
     # auto loading of galaxies
     obj.galX = 0.0
     obj.galY = 0.0
     obj.galXStep = 100.0
     obj.galYStep = 100.0
     obj.galFilename = ''
     obj.galID = ''
コード例 #9
0
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.x = 0.0
     obj.y = 0.0
     obj.planets = []
     obj.fleets = []
     obj.closeFleets = []
     obj.starClass = u'---' # Star clasification
     obj.signature = 100
     # renaming
     obj.lastNameChng = 0
     # combat
     obj.combatCounter = 0
     # system wide data
     obj.scannerPwrs = {}
     # mine field
     obj.minefield = {}  # for every owner (key) list of minefield (triplet) exists (mine_id, amount, last_deployed)
コード例 #10
0
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.x = 0.0
     obj.y = 0.0
     obj.radius = 0.0
     obj.centerWeight = 250.0
     obj.systems = []
     obj.startingPos = []
     obj.numOfStartPos = 0
     obj.timeEnabled = 0  # TODO change to 0
     obj.timeStopped = 0
     obj.creationTime = 0.0
     obj.imperator = OID_NONE
     obj.description = ""
     # electromagnetic radiation
     obj.emrLevel = 1.0
     obj.emrTrend = 1.0
     obj.emrTime = 0
コード例 #11
0
ファイル: IGalaxy.py プロジェクト: mozts2005/OuterSpace
	def init(self, obj):
		IObject.init(self, obj)
		#
		obj.x = 0.0
		obj.y = 0.0
		obj.radius = 0.0
		obj.centerWeight = 250.0
		obj.systems = []
		obj.startingPos = []
		obj.numOfStartPos = 0
		obj.timeEnabled = 0 # TODO change to 0
		obj.timeStopped = 0
		obj.creationTime = 0.0
		obj.imperator = OID_NONE
		obj.description = ""
		# electromagnetic radiation
		obj.emrLevel = 1.0
		obj.emrTrend = 1.0
		obj.emrTime = 0
コード例 #12
0
ファイル: ISystem.py プロジェクト: mozts2005/OuterSpace
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.x = 0.0
     obj.y = 0.0
     obj.planets = []
     obj.fleets = []
     obj.closeFleets = []
     obj.starClass = u'---' # Star clasification
     obj.signature = 100
     # rotation
     #~ obj.dist = 0.0
     #~ obj.dAngle = 0.0
     #~ obj.sAngle = 0.0
     # renaming
     obj.lastNameChng = 0
     # combat
     obj.combatCounter = 0
     # system wide data
     obj.scannerPwrs = {}
     # mine field
     obj.minefield = {}
コード例 #13
0
 def init(self, obj):
     IObject.init(self, obj)
     #
     obj.x = 0.0
     obj.y = 0.0
     obj.planets = []
     obj.fleets = []
     obj.closeFleets = []
     obj.starClass = u'---'  # Star clasification
     obj.signature = 100
     # rotation
     #~ obj.dist = 0.0
     #~ obj.dAngle = 0.0
     #~ obj.sAngle = 0.0
     # renaming
     obj.lastNameChng = 0
     # combat
     obj.combatCounter = 0
     # system wide data
     obj.scannerPwrs = {}
     # mine field
     obj.minefield = {}
コード例 #14
0
	def init(self, obj):
		IObject.init(self, obj)
		#
		obj.x = 0.0
		obj.y = 0.0
		obj.oldX = 0.0
		obj.oldY = 0.0
		obj.orbiting = OID_NONE
		obj.closeSystem = OID_NONE
		obj.speed = 0.0
		obj.maxSpeed = 0.0
		obj.signature = 0
		obj.eta = 0.0
		obj.target = OID_NONE
		#
		obj.operEn = 0
		obj.storEn = 0
		obj.maxEn = 0
		obj.operProd = 0.0
		obj.ships = []
		# action
		obj.actions = []
		obj.actionIndex = 0
		obj.actionWaitCounter = 1
		#
		obj.speedBoost = 1.0
		obj.combatPwr = 0
		obj.isMilitary = 0
		obj.scannerPwr = 0
		obj.origScannerPwr = 0
		obj.scannerOn = True
		obj.combatExp = 0
		obj.combatCounter = 0
		obj.combatRetreatWait = 0
		obj.lastUpgrade = 0
		#
		obj.customname = None
		obj.allowmerge = 1 #states: 0: no merge; 1: normal merging; 2: fleets can merge with this fleet, but this fleet cannot merge with others
コード例 #15
0
	def init(self, obj):
		IObject.init(self, obj)
		#
		obj.x = 0.0
		obj.y = 0.0
		obj.plDiameter = 0
		obj.plType = u'-'
		obj.plMin = 0
		obj.plBio = 0
		obj.plEn = 0
		obj.plEnv = 0
		obj.plSlots = 0
		obj.plMaxSlots = 0
		obj.plStratRes = 0
		obj.plDisease = 0
		obj.plStarting = 0
		obj.orbit = 0
		obj.storPop = 0
		obj.slots = []
		# storage
		obj.storBio = 0
		obj.storEn = 0
		obj.minBio = Rules.colonyMinBio
		obj.minEn = Rules.colonyMinEn
		obj.maxBio = 0
		obj.maxEn = 0
		# changes/prod
		obj.prodQueue = []
		obj.changeBio = 0
		obj.changeEn = 0
		obj.changePop = 0
		obj.changeEnv = 0
		obj.prodProd = 0
		obj.effProdProd = 0
		obj.prodSci = 0
		obj.effProdSci = 0
		obj.unemployedPop = 0
		# eating / housing
		obj.popEatBio = 10
		obj.popEatEn = 0
		obj.maxPop = 0
		# extra goodies
		obj.solarmod = 0
		obj.scannerPwr = 0
		obj.signature = 75
		obj.autoMinStor = 1
		obj.morale = Rules.maxMorale
		obj.changeMorale = 0.0
		obj.moraleTrgt = 0.0
		obj.revoltLen = 0
		obj.combatExp = 0
		obj.isMilitary = 0
		obj.refuelMax = 0
		obj.refuelInc = 0
		obj.repairShip = 0.0
		obj.upgradeShip = 0.0
		obj.trainShipInc = 0
		obj.trainShipMax = 0
		obj.fleetSpeedBoost = 1.0
		obj.ownerSince = 0
		obj.shield = 0          #current planetary shield level
		obj.maxShield = 0       #structural max sheild (best structure method)
		obj.prevShield = 0      #previous turn's shield level (for client growth calculation)
コード例 #16
0
ファイル: IPlayer.py プロジェクト: mozts2005/OuterSpace
	def getPublicInfo(self, tran, obj):
		result = IObject.getPublicInfo(self, tran, obj)
		result.type = obj.type
		result.name = obj.name
		return result
コード例 #17
0
 def getPublicInfo(self, tran, obj):
     result = IObject.getPublicInfo(self, tran, obj)
     result.type = obj.type
     result.name = obj.name
     return result