public override void Reset()
        {
            base.Reset();

            summon       = null;
            releaseTimer = 0;
        }
        public override void LogicUpdate(int deltaTime)
        {
            base.LogicUpdate(deltaTime);

            if (startGenerateSummon && skillEnable)
            {
                if (releaseTimer >= skillActionHitTime && summon == null)
                {
                    summon = GenerateSummon(this, carrierId, summonBrithPosition, owner.direction);
                    summon.RegisterDestroyHandler(PostDestroy);
                    summon.RegisterRenderMessageHandler(PostRenderMessage);
                    summon.RegisterRandomMethod(GetRandomNumber);
                    summon.RegisterFindNeutralUnit(FindNeutralUnit);
                    summon.RegisterFindNeutralUnits(FindNeutralUnits);
                    summon.RegisterFindOpponentBuildings(FindOpponentBuildings);
                    summon.RegisterFindOpponentCrystalCar(FindOpponentCrystalCar);
                    summon.RegisterFindOpponentCrystalCars(FindOpponentCrystalCars);
                    summon.RegisterFindOpponentDemolisher(FindOpponentDemolisher);
                    summon.RegisterFindOpponentDemolishers(FindOpponentDemolishers);
                    summon.RegisterFindOpponentSoldier(FindOpponentSoldier);
                    summon.RegisterFindOpponentSoldiers(FindOpponentSoldiers);
                    summon.RegisterWithinFrontSectorAreaPredicate(WithinCircleAreaPredicate);

                    RenderMessage rm = new RenderMessage();
                    rm.type      = RenderMessage.Type.SpawnSummonedUnit;
                    rm.ownerId   = summon.id;
                    rm.position  = summon.position.vector3;
                    rm.direction = summon.direction.vector3;
                    rm.arguments.Add("mark", owner.mark);
                    rm.arguments.Add("metaId", summon.metaId);
                    PostRenderMessage(rm);
                }

                releaseTimer += deltaTime;
            }
        }
Beispiel #3
0
 public SummonedUnitFsmDeath(SummonedUnit summon)
 {
     owner = summon;
 }
 public SummonedUnitFsmFight(SummonedUnit summon)
 {
     owner = summon;
 }
 public SummonedUnitFsmIdle(SummonedUnit summon)
 {
     owner = summon;
 }
 public SummonedUnitFsmDying(SummonedUnit summon)
 {
     owner = summon;
 }
 public SummonedUnitFsmBorn(SummonedUnit summon)
 {
     owner = summon;
 }