def __init__(self, t): super(Boss3, self).__init__() self.isBossRush = t[2] self.x = 256 self.y = 8 self.left = 16 self.top = 9 self.right = 63 self.bottom = 38 self.hp = boss.BOSS_3_HP self.layer = gcommon.C_LAYER_SKY self.score = 10000 self.subcnt = 0 self.hitcolor1 = 13 self.hitcolor2 = 7 self.body = Boss3Body() self.body.y = 72 self.anchor = Boss3Anchor() self.collisionRects = gcommon.Rect.createFromList( [[8, 0, 72, 15], [24, 16, 71, 29], [40, 30, 62, 129 + 16], [24, 130 + 16, 71, 143 + 16], [8, 144 + 16, 72, 159 + 16]]) self.mode = 0 self.modeCnt = 0 self.body_min_y = 16 self.body_max_y = 128 self.cycleCount = 0 self.shotCycle = __class__.shotCycles[GameSession.difficulty] self.mainShotCycle = int(self.shotCycle * 0.75) self.timerObj = None if self.isBossRush: self.timerObj = enemy.Timer1.create(40) gcommon.debugPrint("Boss3")
def broken(self): for feeler in self.feelers: feeler.remove() for feelerShot in self.feelerShots: feelerShot.remove() for cell in self.bossCells: if cell.removeFlag == False: cell.remove() self.remove() enemy.removeEnemyShot() ObjMgr.objs.append( boss.BossExplosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY)) GameSession.addScore(self.score) BGM.sound(gcommon.SOUND_LARGE_EXP) enemy.Splash.append(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY) if self.isBossRush: gcommon.debugPrint("Boss2 call NextEvent") if self.timerObj != None: self.timerObj.stop() self.timerObj = None ObjMgr.objs.append(enemy.NextEvent([0, None, 240])) else: ObjMgr.objs.append(enemy.Delay(enemy.StageClear, None, 240))
def __init__(self, t): super(Boss4, self).__init__() self.isBossRush = t[2] self.x = 256 self.y = 80 self.layer = gcommon.C_LAYER_SKY self.left = 27 self.top = 8 self.right = 87 self.bottom = 45 self.hp = boss.BOSS_4_HP self.subState = 0 self.subCnt = 0 self.hitcolor1 = 9 self.hitcolor2 = 10 self.missileState = 0 self.missileObj = [None, None, None] self.missileIndex = 0 self.homingMissileInterval = 60 self.homingMissileCnt = 0 self.homingMissileFlag = False self.score = 12000 self.timerObj = None if self.isBossRush: self.timerObj = enemy.Timer1.create(35) gcommon.debugPrint("Boss4")
def update(self): self.mover.update() if self.x <= -96 or self.x >= gcommon.SCREEN_MAX_X+96 or self.y <= -96 or self.y >= gcommon.SCREEN_MAX_Y+96: self.remove() if self.cnt < 10: gcommon.debugPrint("ContainerCarrier1 is ng start point (" + str(self.mx) + ","+ str(self.my) +") (" + str(self.x) + "," + str(self.y)+"") return
def update(self): if pyxel.btnp(pyxel.KEY_Q): for obj in ObjMgr.objs: gcommon.debugPrint(str(obj)) pyxel.quit() if self.nextScene != None: self.nextScene.init() self.scene = self.nextScene self.nextScene = None self.scene.update()
def selectNextStage(self): stageManager = stage.StageLinkManager() gcommon.debugPrint("selectNextStage " + self.stage) stageList = stageManager.findNextStageList(self.stage) if stageList == None: gcommon.debugPrint("next stageList is None") GameSession.stage = "-1" self.startEnding() else: #self.startStage(stageList[0].stage) self.setScene( stageSelect.NextStageSelectScene(self, self.stage, None))
def addScore(cls, score): __class__.score += score __class__.scoreCheck += score if __class__.scoreFirstExtend == False and __class__.scoreCheck >= 20000: __class__.playerStock += 1 __class__.scoreFirstExtend = True BGM.sound(gcommon.SOUND_EXTENDED, gcommon.SOUND_CH1) gcommon.debugPrint("First Extended") elif __class__.scoreCheck >= 50000: __class__.playerStock += 1 __class__.scoreCheck = 0 BGM.sound(gcommon.SOUND_EXTENDED, gcommon.SOUND_CH1) gcommon.debugPrint("Extended by 50000")
def __init__(self, t): super(MovableBattery1, self).__init__() self.mx = t[2] self.my = t[3] pos = gcommon.mapPosToScreenPos(t[2], t[3]) self.x = pos[0] + 3.5 self.y = pos[1] + 3.5 self.firstShot = t[4] self.moveTable = t[5] if self.x <= -96 or self.x >= gcommon.SCREEN_MAX_X+96 or self.y <= -96 or self.y >= gcommon.SCREEN_MAX_Y+96: gcommon.debugPrint("MovableBattery1 is ng start point (" + str(self.mx) + ","+ str(self.my) +") (" + str(self.x) + "," + str(self.y)+"") else: ObjMgr.addObj(MovableBattery1p(self.x, self.y, self.firstShot, self.moveTable)) self.remove()
def update(self): if self.state == 0: self.size += 0.05 if self.size > 1.0: self.size = 1.0 self.nextState() gcommon.debugPrint("to State1") elif self.state == 1: if self.cnt > self.beamTime: self.nextState() gcommon.debugPrint("to State2") else: self.size -= 0.05 if self.size < 0.05: self.remove() return self.x = self.parent.x + self.offsetX self.y = self.parent.y + self.offsetY self.xpolygonList1 = gcommon.getAnglePolygons2([self.x, self.y], self.polygonList1, [0,0], self.rad, 1.0, self.size) self.xpolygonList2 = gcommon.getAnglePolygons2([self.x, self.y], self.polygonList1, [0,0], self.rad, 1.0, self.size*0.8) self.xpolygonList3 = gcommon.getAnglePolygons2([self.x, self.y], self.polygonList1, [0,0], self.rad, 1.0, self.size*0.5)
def update(self): if self.state == 0: if self.x <= 170: self.nextState() elif self.state == 1: if self.cnt == 80: self.layer = gcommon.C_LAYER_SKY self.ground = False self.dx = 0.05 self.dy = 0.0 self.nextState() elif self.state == 2: self.x += self.dx self.y += self.dy if self.x > 150: self.dx = 0 self.hp = boss.BOSS_2_HP # ここでHPを入れなおす self.setState(4) gcommon.debugPrint("x=" + str(self.x) + " y=" + str(self.y) + " dx=" + str(self.dx) + " dy=" + str(self.dy)) elif self.state == 4: self.x += self.dx self.y += self.dy self.brake = False mode = boss2tbl[self.tblIndex][0] if mode == 0: if self.subcnt == boss2tbl[self.tblIndex][3]: self.nextTbl() elif mode == 1: if self.x < boss2tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 self.brake = True if abs(self.dx) < 0.01: self.dx = 0 self.nextTbl() else: self.addDxDy() elif mode == 2: if self.x > boss2tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 self.brake = True if abs(self.dx) < 0.01: self.dx = 0 self.nextTbl() else: self.addDxDy() elif mode == 3: # 上制限(上移動) if self.y < boss2tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 self.brake = True if abs(self.dy) <= 0.01: self.nextTbl() else: self.addDxDy() elif mode == 4: # 下制限(下移動) if self.y > boss2tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 self.brake = True if abs(self.dy) <= 0.01: self.nextTbl() else: self.addDxDy() elif mode == 5: # 触手伸ばす if self.subcnt == 1: self.feelers[0].subDr = -1 self.feelers[1].subDr = 1 self.feelers[2].subDr = -1 self.feelers[3].subDr = 1 self.feelers[0].setMode(1) self.feelers[1].setMode(1) self.feelers[2].setMode(1) self.feelers[3].setMode(1) if self.subcnt == boss2tbl[self.tblIndex][3]: self.feelers[0].setMode(2) self.feelers[1].setMode(2) self.feelers[2].setMode(2) self.feelers[3].setMode(2) self.nextTbl() elif mode == 6: # 触手縮める if self.subcnt == 1: self.feelers[0].setMode(3) self.feelers[1].setMode(3) self.feelers[2].setMode(3) self.feelers[3].setMode(3) if self.subcnt == boss2tbl[self.tblIndex][3]: self.nextTbl() elif mode == 100: # 指定インデックスに移動 self.tblIndex = boss2tbl[self.tblIndex][3] self.cycleCount += 1 self.subcnt = 0 attack = boss2tbl[self.tblIndex][4] if attack == 1: # 触手伸ばす攻撃 #if self.cycleCount & 1 == 0: if self.subcnt == 1: self.shotBoss2Feeler(self.x + 16, self.y + 29, math.pi * 0.75) BGM.sound(gcommon.SOUND_FEELER_GROW) elif self.subcnt == 20: self.shotBoss2Feeler(self.x + 16, self.y + 8, math.pi * 1.25) elif self.subcnt == 40 and GameSession.isNormalOrMore(): self.shotBoss2Feeler(self.x + 50, self.y + 8, math.pi * 1.5) elif self.subcnt == 60 and GameSession.isHard(): self.shotBoss2Feeler(self.x + 50, self.y + 29, math.pi * 0.5) self.subcnt += 1 elif self.state == 900: self.x -= 1 if self.x <= 150: self.dx = 0.0 self.dy = 0.0 self.timerObj = enemy.Timer1.create(30) self.hp = boss.BOSS_2_HP self.setState(4)
def __init__(self, t): gcommon.eventManager = story.BossRushManager() gcommon.eventManager.nextEvent() gcommon.debugPrint("InitBossRushManager")
def update(self): # 向き self.isLeft = (self.x + 52) > ObjMgr.myShip.x self.beam = 0 if self.state == 0: self.x -= gcommon.cur_scroll_x if self.cnt % 60 == 0: self.shotFix4() if self.cnt > 260: self.nextState() elif self.state == 1: # 指定位置まで移動 self.x -= gcommon.cur_scroll_x self.x += 0.625 self.y -= 0.20 #0.125 if self.cnt % 60 == 0: self.shotFix4() if self.cnt > 270: self.nextState() elif self.state == 2: # 指定位置まで移動 self.y += 0.25 if self.cnt % 60 == 0: self.shotFix4() if self.cnt > 120: # x=159 y=36 self.nextState() gcommon.debugPrint("x = " + str(self.x) + " y = " + str(self.y)) self.hp = boss.BOSS_1_HP elif self.state == 3: # 4、8方向ショット if self.subState == 0: self.y -= 0.250 if self.y < 0: self.y = 0 else: self.y += 0.250 if self.y > 150: self.y = 150 if self.cnt & 15 == 15: if GameSession.isNormalOrLess(): self.shotFix4() else: self.shotFix8() #if self.cnt & 31 == 31: # self.shotFix4() #else: if self.cnt > 120: self.nextState() BGM.sound(gcommon.SOUND_BOSS1PREBEAM) if self.subState == 0: self.subState = 1 else: self.subState = 0 elif self.state == 4: # ビーム発射前 if self.cnt & 1 == 1: x = 50 + random.random() * 30 y = random.random() * 6 a = 200 + random.random() * 500 if self.cnt & 3 == 3: a *= -1 self.tbl.append(Boss1Star(x, y, a)) newTbl = [] for s in self.tbl: s.x -= 2 if s.x >= 0: newTbl.append(s) self.tbl = newTbl if self.cnt > 90: self.nextState() BGM.sound(gcommon.SOUND_BOSS1BEAM) elif self.state == 5: # ビーム発射開始(移動なし) self.beam = int(self.cnt / 3) + 1 if self.beam > 5: self.nextState() elif self.state == 6: # ビーム発射中(移動なし) self.beam = 6 self.beamObj.hitCheck = True if self.cnt > 60: self.nextState() elif self.state == 7: # ビーム発射中(移動あり) self.beam = 6 zy = abs(self.y + 30 - ObjMgr.myShip.y) if zy > 80: self.dy = 3 elif zy > 50: self.dy = 2 elif zy > 20: self.dy = 1 else: self.dy = 0.25 if self.y + 30 > ObjMgr.myShip.y: self.dy = -self.dy self.y += self.dy if GameSession.isNormal(): if self.cnt % 45 == 0: self.shotFix4() elif GameSession.isHard(): if self.cnt % 30 == 0: self.shotFix4() if self.cnt > self.beamTime: self.nextState() elif self.state == 8: self.dy = 0.0 # ビーム発射終了(移動なし) self.beam = 5 - int(self.cnt / 3) self.beamObj.hitCheck = False if self.beam < 0: self.setState(3) elif self.state == 900: # ボスラッシュ時の初期 self.x -= 1.0 if self.x <= 159: self.timerObj = enemy.Timer1.create(30) self.hp = boss.BOSS_1_HP self.setState(3)