コード例 #1
0
        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;
                                DollyMinionMinion newDolly = new DollyMinionMinion(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();
                }
            }
        }
コード例 #2
0
        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;
                                DollyMinionMinion newDolly = new DollyMinionMinion(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();
            }
        }