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; }
void RemoveEffect(BlockCommandEntity effectType) { foreach (var entity in blocks) { if (entity.blockResource != null) { entity.blockResource.RemoveEffectObject(effectType.chargeVFX); } } }
static bool IsLastCharge(int chargeCount, BlockEntity blockEntity, BlockCommandEntity blockCommandEntity) { if (chargeCount == blockEntity.maxChargeCount) { return true; } if (blockCommandEntity.maxChargePoint == 0f) { return true; } return false; }
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); }
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); } } }
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; } }