public override void step() { if (destroyable == false) { if (minionState == MinionState.ALIVE) { if (stats.health <= 0) { onDeath(); } else { walk(); if (heritanceLevel < 3 && numOfCopies < MAX_COPIES) { if (effectCooldownTime - Chronos.deltaTime <= 0) { effectCooldownTime = DEFAULT_EFFECT_COOLDOWN_TIME; DollyMinion newDolly = new DollyMinion(this.game, this.ownerPlayer, heritanceLevel + 1); PathPosition newPos = new PathPosition(0, 0); numOfCopies++; position.board.getPath().move(this.position.pathPosition, -0.2f * numOfCopies, out newPos); this.position.board.AddMinionSpecificPosition(newDolly, newPos); Science_Wars_Server.Messages.OutgoingMessages.Game.GCopyMinionResult.sendMessage(game.players, newDolly); } else { effectCooldownTime -= Chronos.deltaTime; } } } } else if (minionState == MinionState.DEAD && isReadyToDestroy()) // minionState i tekrar kontrol ettim. ne olur ne olmaz yeni bir state eklersek patlamasin. { onDestroy(); } } }
public override void step() { if (destroyable == false) { if (minionState == MinionState.ALIVE) { if (stats.health <= 0) { onDeath(); } else { walk(); if (heritanceLevel < 3 && numOfCopies < MAX_COPIES) { if (effectCooldownTime - Chronos.deltaTime <= 0) { effectCooldownTime = DEFAULT_EFFECT_COOLDOWN_TIME; DollyMinion newDolly = new DollyMinion(this.game, this.ownerPlayer, heritanceLevel + 1); PathPosition newPos = new PathPosition(0, 0); numOfCopies++; position.board.getPath().move(this.position.pathPosition, -0.2f * numOfCopies, out newPos); this.position.board.AddMinionSpecificPosition(newDolly, newPos); Science_Wars_Server.Messages.OutgoingMessages.Game.GCopyMinionResult.sendMessage(game.players, newDolly); } else { effectCooldownTime -= Chronos.deltaTime; } } } } else if (minionState == MinionState.DEAD && isReadyToDestroy()) // minionState i tekrar kontrol ettim. ne olur ne olmaz yeni bir state eklersek patlamasin. onDestroy(); } }