Ejemplo n.º 1
0
 public BlockCommand(BlockCommandEntity entity, int inARowCount, int matchGeneration)
     : base(GetSkillEntity(entity.skillID), false, null)
 {
     this.entity = entity;
     this.isChargedAttack = entity.chargeCount > 0;
     this.inARowCount = inARowCount;
     this.matchGeneration = matchGeneration;
 }
Ejemplo n.º 2
0
 void RemoveEffect(BlockCommandEntity effectType)
 {
     foreach (var entity in blocks)
     {
         if (entity.blockResource != null)
         {
             entity.blockResource.RemoveEffectObject(effectType.chargeVFX);
         }
     }
 }
Ejemplo n.º 3
0
 static bool IsLastCharge(int chargeCount, BlockEntity blockEntity, BlockCommandEntity blockCommandEntity)
 {
     if (chargeCount == blockEntity.maxChargeCount)
     {
         return true;
     }
     if (blockCommandEntity.maxChargePoint == 0f)
     {
         return true;
     }
     return false;
 }
Ejemplo n.º 4
0
    public Matching(PuzzlePanel panel, Pattern pattern, int x, int y, BlockEntity blockEntity, Block[] blocks)
    {
        this.panel = panel;
        this.pattern = pattern;
        this.x = x;
        this.y = y;
        this.blockEntity = blockEntity;
        this.blocks = blocks;

        chargeCount = 0;
        chargePoint = 0;
        blockCommandEntity = blockCommandTable.Get(blockEntity.HeroType, blockEntity.BlockType, chargeCount);
        AttachEffect(blockCommandEntity);
    }
Ejemplo n.º 5
0
    void AttachEffect(BlockCommandEntity effectType)
    {
        foreach (var entity in blocks)
        {
            if (entity.blockResource != null)
            {
                entity.blockResource.AttachEffectObject(effectType.chargeVFX);
            }
        }

        if (effectType != null)
        {
            if (effectType.chargeSFX > 0)
            {
                panel.PlaySound(effectType.chargeSFX);
            }
        }
    }
Ejemplo n.º 6
0
    public void Update(float deltaTime)
    {
        if (!IsLastCharge(chargeCount, blockEntity, blockCommandEntity))
        {
            chargePoint += ChargePerSecond * deltaTime;

            if (chargePoint >= blockCommandEntity.maxChargePoint)
            {
                if (chargeCount > 0)
                {
                    RemoveEffect(blockCommandEntity);
                }

                chargeCount += 1;
                chargePoint -= blockCommandEntity.maxChargePoint;

                blockCommandEntity = blockCommandTable.Get(blockEntity.HeroType, blockEntity.BlockType, chargeCount);
                AttachEffect(blockCommandEntity);
            }

            maxChargePoint = blockCommandEntity.maxChargePoint;
        }
    }