def __init__(self): DEBUG_MSG("Space:__init__") KBEngine.Base.__init__(self) EntityObject.__init__(self) self.spaceName = self.cellData["spaceName"] self.spaceData = space_data.data[self.cellData["name"]] # 取出自身的场景数据 # self.gateWayEntrancePosition = self.spaceData["传送门入口点"] self.createInNewSpace(None)
def __init__(self): KBEngine.Entity.__init__(self) EntityObject.__init__(self) DEBUG_MSG("Trigger:__init__") DEBUG_MSG(self.triggerStrategy) if self.lifeSpans <= 0: pass else: self.addTimer(self.lifeSpans, 0, 0)
def __init__(self): DEBUG_MSG("BigWorld:__init__") KBEngine.Entity.__init__(self) EntityObject.__init__(self) KBEngine.globalData["space_%i" % self.spaceID] = self.base KBEngine.globalData["BigWorld_Cell"] = self self.timerID = self.addTimer(2, 0.1, 0) # 创建传送门触发器 # self.gateWayTrigger = KBEngine.createEntity("GateWayTrigger", self.spaceID, (10.0, 1.0, 10.0), (0.0, 0.0, 0.0), {}) # 生成Npc self.npcList = {} # 木精怪的字典,大小为5 self.muJingGuaiMonsters = {} # 岩石灵怪的字典,大小为5 self.yanShiLingGuaiMonsters = {} # self.npcList["新手引导"] = KBEngine.createEntity("Npc", self.spaceID, (202.0, 0.0, 253.0), (0.0, 0.0, 0.0), {"entityName": "新手引导"}) self.npcList["商人"] = KBEngine.createEntity("Npc", self.spaceID, (204.0, 0.0, 277.0), (0.0, 180.0, 0.0), { "entityName": "商人", 'modelName': "StoreNpc" }) # self.monsterSpawnPointData = monster_spawnpoint_data.data # MuJingGuai怪物的出生点 self.spawnMuJingGuaiPos = space_data.data["木灵村"]["怪物数据"]["木精怪"] # yanShiLingGuai怪物的出生点 self.spawnYanShiLingGuaiPos = space_data.data["木灵村"]["怪物数据"]["炎石灵怪"] # 生成木精怪怪物 for x in self.spawnMuJingGuaiPos: self.muJingGuaiMonsters[x] = KBEngine.createEntity( "Monster", self.spaceID, x, (0.0, 0.0, 0.0), { 'entityName': "木精怪", 'modelName': "MuJingGuai" }) self.muJingGuaiMonsters[x].receiveSpawnPos(x) self.muJingGuaiMonsters[x].setAttr("killerTaskCounterVariableName", "MuJingGuai_TaskCounter") # 生成炎石灵怪怪物 for x in self.spawnYanShiLingGuaiPos: self.yanShiLingGuaiMonsters[x] = KBEngine.createEntity( "Monster", self.spaceID, x, (0.0, 0.0, 0.0), { 'entityName': "炎石灵怪", 'modelName': "YanShiLingGuai" }) self.yanShiLingGuaiMonsters[x].receiveSpawnPos(x) self.yanShiLingGuaiMonsters[x].setAttr( "killerTaskCounterVariableName", "YanShiLingGuai_TaskCounter")
def __init__(self): DEBUG_MSG("Monster::__init__") KBEngine.Entity.__init__(self) EntityObject.__init__(self) CombatEntity.__init__(self) AI.__init__(self) self.spawnPos = (0, 0, 0) self.timerMoveID = self.addTimer(0, 4, 1) self.monsterData = monster_data.data[self.name] self.modelName = self.monsterData["模型名称"] DEBUG_MSG("modelName is " + str(self.modelName)) self.HP = self.monsterData["生命值"] self.HP_Max = self.monsterData["生命值"] self.killerTaskCounterVariableName = self.modelName + "_TaskCounter"
def __init__(self): KBEngine.Entity.__init__(self) EntityObject.__init__(self) DEBUG_MSG("Space:cell:__init__ " + str(self.spaceID) + " " + str(self.id) + " " + self.spaceName) self.npcList = {} KBEngine.globalData["space_%i" % self.spaceID] = self.base KBEngine.globalData["space_" + self.spaceName] = self.base KBEngine.globalData["space_cell_%i" % self.spaceID] = self KBEngine.globalData["space_cell_" + self.spaceName] = self self.spaceData = space_data.data[self.name] # 取出自身的场景数据 self.respawnPoint = self.spaceData["重生点"] self.addTimer(0, 2, 0) # 怪物生成定时器 每2秒生成5个 self.monsterSpawnCounter = {} self.monsterSpawnPositionList = self.spaceData["怪物数据"] # 怪物出生点列表 for monsterName, monsterSpawnPositionList in self.monsterSpawnPositionList.items(): self.monsterSpawnCounter[monsterName] = 0 self.npcsData = self.spaceData["Npc数据"] # 取出场景Npc数据 for npcName, npcData in self.npcsData.items(): self.npcList[npcName] = KBEngine.createEntity("Npc", self.spaceID, npcData["坐标"], (0.0, 0.0, 0.0), { "npcID": npcData["id"], "name": npcName, "entityName": npcName, 'modelName': npcData["模型名称"] }) # 创建Npc self.triggerData = self.spaceData["触发器数据"] # 取出场景触发器数据 for triggerData in self.triggerData.values(): exec("self.triggerStrategy = " + triggerData["触发器类型"] + "Strategy()") DEBUG_MSG(self.triggerStrategy) self.triggerStrategy.setData(triggerData) trigger = KBEngine.createEntity("Trigger", self.spaceID, triggerData["触发器坐标"], (0.0, 0.0, 0.0), { 'name': "GateWayTrigger", 'lifeSpans': 0, 'triggerSize': 4, "triggerStrategy": self.triggerStrategy }) # 创建触发器
def __init__(self): KBEngine.Base.__init__(self) EntityObject.__init__(self) self.timerID = self.addTimer(1, 1, 0)
def __init__(self): EntityObject.__init__(self) DEBUG_MSG("Avatar:__init__") KBEngine.Proxy.__init__(self)
def __init__(self): DEBUG_MSG("Sectarian:_init_") KBEngine.Entity.__init__(self) EntityObject.__init__(self)